Skip to content

Commit

Permalink
feat(annotations): sélectionne 'en cours de traitement' par défaut
Browse files Browse the repository at this point in the history
  • Loading branch information
thom4parisot committed Feb 12, 2024
1 parent 7e6ac0a commit 6967c65
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/components/Features/AnnotationsSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<label class="fr-label" for="reduced_conversion_period_state">Information sur la dérogation</label>

<select class="fr-select" name="reduced_conversion_period_state" id="reduced_conversion_period_state" :value="getMetadata(ANNOTATIONS.REDUCED_CONVERSION_PERIOD, ANNOTATIONS.METADATA_STATE)" @change="updateMetadata(ANNOTATIONS.REDUCED_CONVERSION_PERIOD, ANNOTATIONS.METADATA_STATE, $event.target.value)">
<option value="">Sélectionner le statut</option>
<option :value="key" :key="key" v-for="({ label }, key) in reducedConversionStates">
{{ label }}
</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ describe("SingleItemCertificationBodyForm", () => {
await form.find(`.fr-tags-group--annotations > .annotation--${ANNOTATIONS.REDUCED_CONVERSION_PERIOD} button`).trigger('click')
await form.find(`.fr-tags-group--annotations > .annotation--${ANNOTATIONS.RISKY} button`).trigger('click')

expect(form.find('#reduced_conversion_period_state').element.value).toEqual(CERTIFICATION_BODY_DECISION.PENDING)
expect(form.find('#reduced_conversion_period_state').element.selectedOptions[0].textContent).toEqual('En cours de traitement')

// we toggle and cancel the tag
await form.find(`.fr-tags-group--annotations > .annotation--${ANNOTATIONS.SURVEYED} button`).trigger('click')
await form.find(`.fr-tags-group--annotations > .annotation--${ANNOTATIONS.SURVEYED} button`).trigger('click')
Expand Down
4 changes: 4 additions & 0 deletions src/referentiels/ab.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export const ANNOTATIONS = {
* @enum {String}
*/
export const CERTIFICATION_BODY_DECISION = {
PENDING: '',
ACCEPTED: 'accepted',
REJECTED: 'rejected'
}
Expand Down Expand Up @@ -208,6 +209,9 @@ export const AnnotationTags = {
label: 'Réduction de conversion',
metadata: {
[ANNOTATIONS.METADATA_STATE]: {
[CERTIFICATION_BODY_DECISION.PENDING]: {
label: 'En cours de traitement'
},
[CERTIFICATION_BODY_DECISION.ACCEPTED]: {
label: 'Dérogation acceptée'
},
Expand Down

0 comments on commit 6967c65

Please sign in to comment.