-
Notifications
You must be signed in to change notification settings - Fork 2
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
Enregistrement de la date de début de certif si elle est absente #350
base: v2
Are you sure you want to change the base?
Conversation
e4125eb
to
da6aee9
Compare
…le est absente Un parcellaire peut être certifié par API, sans avoir ces dates de renseignées.
da6aee9
to
437cfd3
Compare
J'ai tenté de tester au mieux l'aspect "envoi des données" ; est-ce que t'as des suggestions par rapport à la gymnastique de la synchro de stockage ? |
...(patch.certification_date_debut && permissions.canChangeCertificationDate && { certification_date_debut: patch.certification_date_debut }), | ||
...(patch.certification_date_fin && permissions.canChangeCertificationDate && { certification_date_fin: patch.certification_date_fin }) |
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.
Peut-être ici on ne devrait vérifier que la permission de modifier ? Pour que ça laisse la possibilité de retirer les dates de certif… mais ça me semble foireux d'avoir un statut certifié sans plage de validité.
|
||
it("should record field changes", async () => { | ||
const recordId = record.record_id | ||
await storage.addRecord(recordId) |
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.
C'était pas évident de savoir qu'il fallait utiliser "addRecord".
J'ai eu l'impression que ça bloquait le test si je n'ajoutais pas cet appel.
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.
Je ne suis pas sûre de comprendre pourquoi, ça devrait marcher sans en tout cas !
|
||
it("should record field changes", async () => { | ||
const recordId = record.record_id | ||
await storage.addRecord(recordId) |
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.
Je ne suis pas sûre de comprendre pourquoi, ça devrait marcher sans en tout cas !
await modal.find('form').trigger('submit') | ||
await flushPromises() | ||
|
||
expect(axios.__createMock.patch).toHaveBeenCalledWith( |
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.
Du coup le test porte autant sur la couche storage que sur le formulaire (tu pourrais aussi simplement tester qu'une opération de modification a été crée dans la queue de synchro).
Un parcellaire peut être certifié par API, sans avoir ces dates de renseignées.
La date n'est renseignable que si elle n'a pas été précédemment.
L'API privée était déjà en mesure de les enregistrer
refs AgenceBio/cartobio-api#83
refs #220