-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests : vérifier le contenu de la modale confirmant un candidat trouvé par son NIR ou son email #5523
base: master
Are you sure you want to change the base?
Conversation
itou/templates/job_seekers_views/step_search_job_seeker_by_email.html
Outdated
Show resolved
Hide resolved
61a7ae8
to
b282d16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Toujours cool d’augmenter la couverture de tests. 🙏
test_submit.py
est affreux, mais ce n’est pas de ton fait.
itou/templates/job_seekers_views/step_search_job_seeker_by_email.html
Outdated
Show resolved
Hide resolved
response = client.get(check_nir_url) | ||
assert response.status_code == 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dans l’idéal de l’idéal, ce retrait d’assertions en doublon mériterait un autre commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allez, c'était l'argument qu'il me fallait pour que je me note de faire une passe sur ces tests et supprimer ces assertions inutiles 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️, ecaf16c se faisait vieux.
b282d16
to
bed3489
Compare
Petite idée encore plus maline pour l’agencement des commits. Actuellement, le premier commit améliore le rendu sans tests, qui sont ajoutés avec le second commit. |
bed3489
to
9516dd7
Compare
Oh, c'est élégant ! |
tests/gps/test_create_beneficiary.py
Outdated
@@ -21,6 +22,67 @@ | |||
from tests.utils.test import KNOWN_SESSION_KEYS | |||
|
|||
|
|||
def assert_contains_nir_modal_gps(response, job_seeker): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: j'aurais nommé différemment : assert_contains_nir_modal_gps
→ assert_modal_gps_contains_nir
C'est "plus anglais" et introduit une hiérarchie : cible > action > donnée
Dans tous les cas on n'est pas sur la méthode unittest
ni sur les helpers de pytest-django
(et on ne camelize pas nous 😈)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ idem pour les autres méthodes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert_modal_gps_contains_nir
me fait penser à "la modale contient le NIR"
Et là c'est plutôt : "la réponse contient la modale du NIR" (dans le cas GPS).
Qu'en penses-tu ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oui je vois où tu veux en venir.
Disons que l'on n'a qu'une modale par step de ce que j'ai vu donc ça en revient à vérifier le contenu de la modale. Mais par rapport à ton test, qui s'assure bien de la présence d'une modale avec tel contenu, ton nommage est sémantiquement plus juste en effet. Laissons tel quel ou bien : assert_contains_apply_nir_modal
/ assert_contains_gps_nir_modal
/ assert_contains_gps_email_modal
9516dd7
to
e2743a3
Compare
This modal is displayed when a job seeker is found with a NIR or an email. It is more and more complex and we need to test its content.
When finding a job seeker with their email address, and if the NIR was filled in the previous step, a sentence is added to the "User found" modal. This sentence is now better rendered (the final `.` was after a newline, creating a space between the last word and the `.`).
e2743a3
to
ebc25a6
Compare
🤔 Pourquoi ?
Une modale s'affiche lorsqu'on trouve un compte candidat à partir de son NIR ou de son adresse email.
Cette modale s'affiche dans différents contextes (candidature, GPS, …) et devient assez complexe.
Testons son contenu.
🍰 Comment ?
🚨 À vérifier
🏝️ Comment tester ?
💻 Captures d'écran