datenanfragen / website

The Datenanfragen.de website including the request PDF generator and company information database
https://www.datenanfragen.de
MIT License
89 stars 125 forks source link

Implement more tests for the generator #737

Open baltpeter opened 2 years ago

baltpeter commented 2 years ago

We already have a few tests for the generator. They should be expanded with the following:

Tips:

kritikash18 commented 2 years ago

@baltpeter Can I try this?

zner0L commented 2 years ago

@kritikash18 What kinds of tests are your looking to add? Or do you want to add all of them?

kritikash18 commented 2 years ago

@zner0L If all the tests are for generator only, then I can add at least half of them

baltpeter commented 2 years ago

@kritikash18 If you want to be assigned to specific ones, just let us know which ones. Otherwise, feel free to just give it a go and submit a PR without being assigned.

kritikash18 commented 2 years ago

@baltpeter @zner0L I've written and tested some of the required tests. I needed clarity on one of the tests.

When 'erasure request' is selected, the text is changed based on the 'Erase all data' checkbox and the 'Data to erase' field.

For me, when clicking on erase all data checkbox, the only difference I see is that the data to erase field disappears but in the above description, it is mentioned that some text also changes. Am I missing something?

baltpeter commented 2 years ago

@kritikash18 The test description is talking about the generated text. You can see that by clicking the "Send email" button and then selecting one of the methods (for the tests, we usually use "Copy text manually" as that's the easiest for programatically checking the text).

kritikash18 commented 2 years ago

@baltpeter @zner0L I added 5 tests for the following use cases:

1. When 'rectification request' is selected, a 'Correct data' section appears on the right (and disappears for other requests).
2. When 'erasure request' is selected, the text is changed based on the 'Erase all data' checkbox and the 'Data to erase' field.
3. 'Your own text' shows a different form on the right. 
4. Selecting a template for 'Your own text' changes the text.
5. The text and subject entered for 'Your own text' are reflected in the generated request.

Raised #794 Please review