@cnamts/synapse 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -72
- package/dist/{DateFilter-_EFzsvvM.js → DateFilter-isr8mXVb.js} +1 -1
- package/dist/{NumberFilter-CUxEbKJh.js → NumberFilter-BOe7DqWX.js} +1 -1
- package/dist/{PeriodFilter-D5ueqtKy.js → PeriodFilter-WTprpO40.js} +1 -1
- package/dist/{SelectFilter-BciBNydy.js → SelectFilter-CqlG5dmI.js} +1 -1
- package/dist/{TextFilter-DMN_WAQB.js → TextFilter-fVW5bsRw.js} +1 -1
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +60 -28
- package/dist/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +60 -28
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +61 -29
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +5 -1
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +3 -1
- package/dist/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.d.ts +1 -1
- package/dist/components/Captcha/Captcha.d.ts +2 -0
- package/dist/components/Captcha/CaptchaBase.d.ts +1 -0
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +29 -17
- package/dist/components/Customs/SyTabs/SyTabs.d.ts +20 -0
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +100 -10
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +108 -21
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +6 -6
- package/dist/components/DatePicker/composables/useDateFormatDisplay.d.ts +3 -0
- package/dist/components/DatePicker/tests/setup.d.ts +768 -48
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +8 -0
- package/dist/components/HeaderToolbar/HeaderToolbar.d.ts +58 -34
- package/dist/components/LangBtn/LangBtn.d.ts +4 -0
- package/dist/components/PeriodField/PeriodField.d.ts +192 -12
- package/dist/components/RatingPicker/RatingPicker.d.ts +9 -0
- package/dist/components/SearchListField/SearchListField.d.ts +42 -413
- package/dist/components/SearchListField/locales.d.ts +1 -2
- package/dist/components/SyAlert/SyAlert.d.ts +1 -1
- package/dist/components/SyTextArea/SyTextArea.d.ts +2 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +15 -8
- package/dist/components/Tables/SyTable/SyTable.d.ts +15 -8
- package/dist/components/Tables/common/SyTablePagination.d.ts +29 -17
- package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +4 -0
- package/dist/components/Tables/common/types.d.ts +2 -0
- package/dist/design-system-v3.js +1 -1
- package/dist/design-system-v3.umd.cjs +32 -16
- package/dist/{main-DISHlqcd.js → main-CbBVJ_le.js} +9911 -9751
- package/dist/style.css +1 -1
- package/package.json +5 -2
- package/src/assets/amelipro/icons.ts +17 -0
- package/src/components/Amelipro/AmeliproAccordionFrieze/AmeliproAccordionFrieze.stories.ts +40 -36
- package/src/components/Amelipro/AmeliproAccordionGroup/__tests__/AmeliproAccordionGroup.spec.ts +226 -26
- package/src/components/Amelipro/AmeliproAccordionGroup/__tests__/__snapshots__/AmeliproAccordionGroup.spec.ts.snap +55 -506
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.stories.ts +1 -1
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +7 -2
- package/src/components/Amelipro/AmeliproAccordionList/__tests__/__snapshots__/AmeliproAccordionList.spec.ts.snap +2 -1
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/__tests__/__snapshots__/AmeliproAccordionResultTemplate.spec.ts.snap +4 -1
- package/src/components/Amelipro/AmeliproAccordionResult/__tests__/__snapshots__/AmeliproAccordionResult.spec.ts.snap +4 -1
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts +1 -1
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +9 -3
- package/src/components/Amelipro/AmeliproAccordionResultList/__tests__/__snapshots__/AmeliproAccordionResultList.spec.ts.snap +42 -11
- package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.stories.ts +4 -4
- package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.vue +7 -5
- package/src/components/Amelipro/AmeliproAutoCompleteField/__tests__/__snapshots__/AmeliproAutoCompleteField.spec.ts.snap +4 -2
- package/src/components/Amelipro/AmeliproBtn/AmeliproBtn.stories.ts +1 -40
- package/src/components/Amelipro/AmeliproBtn/AmeliproBtn.vue +4 -0
- package/src/components/Amelipro/AmeliproCallback/AmeliproCallback.stories.ts +4 -2
- package/src/components/Amelipro/AmeliproCaptcha/__tests__/__snapshots__/AmeliproCaptcha.spec.ts.snap +2 -1
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.stories.ts +39 -29
- package/src/components/Amelipro/AmeliproCopyBtn/__tests__/__snapshots__/AmeliproCopyBtn.spec.ts.snap +4 -1
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.vue +3 -3
- package/src/components/Amelipro/AmeliproCustomSelector/__tests__/__snapshots__/AmeliproCustomSelector.spec.ts.snap +8 -6
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.mdx +3 -1
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.stories.ts +23 -5
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.vue +5 -6
- package/src/components/Amelipro/AmeliproFilePreview/__tests__/AmeliproFilePreview.spec.ts +2 -2
- package/src/components/Amelipro/AmeliproFilePreview/__tests__/__snapshots__/AmeliproFilePreview.spec.ts.snap +5 -6
- package/src/components/Amelipro/AmeliproFirstLogin/__tests__/__snapshots__/AmeliproFirstLogin.spec.ts.snap +4 -1
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeader.vue +1 -2
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproLogoAm/__tests__/AmeliproLogoAm.spec.ts +78 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproLogoAm/{tests → __tests__}/__snapshots__/AmeliproLogoAm.spec.ts.snap +64 -2
- package/src/components/Amelipro/AmeliproIcon/__tests__/AmeliproIcon.spec.ts +358 -0
- package/src/components/Amelipro/AmeliproIcon/{tests → __tests__}/__snapshots__/AmeliproIcon.spec.ts.snap +30 -3
- package/src/components/Amelipro/AmeliproIcon/iconList.ts +1 -0
- package/src/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.vue +1 -1
- package/src/components/Amelipro/AmeliproIconBtn/__tests__/AmeliproIconBtn.spec.ts +459 -0
- package/src/components/Amelipro/AmeliproIconBtn/__tests__/__snapshots__/AmeliproIconBtn.spec.ts.snap +58 -0
- package/src/components/Amelipro/AmeliproIllustratedDataTile/AmeliproIllustratedDataTile.stories.ts +38 -26
- package/src/components/Amelipro/AmeliproIllustratedDataTile/__tests__/AmeliproIllustratedDataTile.spec.ts +321 -0
- package/src/components/Amelipro/AmeliproIllustratedDataTile/__tests__/__snapshots__/AmeliproIllustratedDataTile.spec.ts.snap +148 -0
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.stories.ts +14 -5
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.vue +1 -1
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/__tests__/AmeliproIllustratedRadioGroup.spec.ts +498 -0
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/__tests__/__snapshots__/AmeliproIllustratedRadioGroup.spec.ts.snap +325 -0
- package/src/components/Amelipro/AmeliproMailTile/__tests__/AmeliproMailTile.spec.ts +210 -0
- package/src/components/Amelipro/AmeliproMailTile/__tests__/__snapshots__/AmeliproMailTile.spec.ts.snap +98 -0
- package/src/components/Amelipro/AmeliproMessage/__tests__/AmeliproMessage.spec.ts +446 -0
- package/src/components/Amelipro/AmeliproMessage/__tests__/__snapshots__/AmeliproMessage.spec.ts.snap +60 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/__tests__/AmeliproMessagingLayout.spec.ts +300 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/__tests__/__snapshots__/AmeliproMessagingLayout.spec.ts.snap +197 -0
- package/src/components/Amelipro/AmeliproNumberedCard/__tests__/AmeliproNumberedCard.spec.ts +117 -0
- package/src/components/Amelipro/AmeliproNumberedCard/{tests → __tests__}/__snapshots__/AmeliproNumberedCard.spec.ts.snap +47 -45
- package/src/components/Amelipro/AmeliproOnboarding/__tests__/AmeliproOnboarding.spec.ts +219 -0
- package/src/components/Amelipro/AmeliproOnboarding/__tests__/__snapshots__/AmeliproOnboarding.spec.ts.snap +41 -0
- package/src/components/Amelipro/AmeliproPageLayout/__tests__/AmeliproPageLayout.spec.ts +129 -0
- package/src/components/Amelipro/AmeliproPageLayout/__tests__/__snapshots__/AmeliproPageLayout.spec.ts.snap +189 -0
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/__tests__/AmeliproPaginationBtn.spec.ts +92 -0
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/__tests__/__snapshots__/AmeliproPaginationBtn.spec.ts.snap +56 -0
- package/src/components/Amelipro/AmeliproPagination/__tests__/AmeliproPagination.spec.ts +165 -0
- package/src/components/Amelipro/AmeliproPagination/__tests__/__snapshots__/AmeliproPagination.spec.ts.snap +83 -0
- package/src/components/Amelipro/AmeliproPatientBanner/__tests__/AmeliproPatientBanner.spec.ts +208 -0
- package/src/components/Amelipro/AmeliproPatientBanner/__tests__/__snapshots__/AmeliproPatientBanner.spec.ts.snap +285 -0
- package/src/components/Amelipro/AmeliproPatientLogged/__tests__/__snapshots__/AmeliproPatientLogged.spec.ts.snap +26 -7
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/__tests__/__snapshots__/AmeliproPostalAddressCityRow.spec.ts.snap +12 -4
- package/src/components/Amelipro/AmeliproRadioGroup/AmeliproRadioGroup.stories.ts +28 -8
- package/src/components/Amelipro/AmeliproRadioGroup/__tests__/AmeliproRadioGroup.spec.ts +332 -0
- package/src/components/Amelipro/AmeliproRadioGroup/__tests__/__snapshots__/AmeliproRadioGroup.spec.ts.snap +255 -0
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.stories.ts +1 -2
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.vue +3 -1
- package/src/components/Amelipro/AmeliproResultList/__tests__/__snapshots__/AmeliproResultList.spec.ts.snap +2 -1
- package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.vue +11 -5
- package/src/components/Amelipro/AmeliproSelect/__tests__/AmeliproSelect.spec.ts +481 -0
- package/src/components/Amelipro/AmeliproSelect/__tests__/__snapshots__/AmeliproSelect.spec.ts.snap +117 -0
- package/src/components/Amelipro/AmeliproStateTile/AmeliproStateTile.vue +5 -2
- package/src/components/Amelipro/AmeliproStateTile/__tests__/AmeliproStateTile.spec.ts +206 -0
- package/src/components/Amelipro/AmeliproStateTile/__tests__/__snapshots__/AmeliproStateTile.spec.ts.snap +158 -0
- package/src/components/Amelipro/AmeliproStatus/__tests__/AmeliproStatus.spec.ts +120 -0
- package/src/components/Amelipro/AmeliproStatus/__tests__/__snapshots__/AmeliproStatus.spec.ts.snap +39 -0
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/__tests__/AmeliproStepBtn.spec.ts +97 -0
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/__tests__/__snapshots__/AmeliproStepBtn.spec.ts.snap +61 -0
- package/src/components/Amelipro/AmeliproStepper/__tests__/AmeliproStepper.spec.ts +248 -0
- package/src/components/Amelipro/AmeliproStepper/__tests__/__snapshots__/AmeliproStepper.spec.ts.snap +179 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.stories.ts +14 -13
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +2 -1
- package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +10 -3
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/__tests__/AmeliproTabBtn.spec.ts +129 -0
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/__tests__/__snapshots__/AmeliproTabBtn.spec.ts.snap +81 -0
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabs.vue +2 -2
- package/src/components/Amelipro/AmeliproTabs/__tests__/AmeliproTabs.spec.ts +234 -0
- package/src/components/Amelipro/AmeliproTabs/__tests__/__snapshots__/AmeliproTabs.spec.ts.snap +122 -0
- package/src/components/Amelipro/AmeliproTextArea/AmeliproTextArea.vue +7 -5
- package/src/components/Amelipro/AmeliproTextArea/__tests__/AmeliproTextArea.spec.ts +265 -9
- package/src/components/Amelipro/AmeliproTextArea/__tests__/__snapshots__/AmeliproTextArea.spec.ts.snap +98 -155
- package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.vue +7 -5
- package/src/components/Amelipro/AmeliproTextField/__tests__/AmeliproTextField.spec.ts +375 -0
- package/src/components/Amelipro/AmeliproTextField/__tests__/__snapshots__/AmeliproTextField.spec.ts.snap +143 -0
- package/src/components/Amelipro/AmeliproTileBtn/__tests__/AmeliproTileBtn.spec.ts +241 -0
- package/src/components/Amelipro/AmeliproTileBtn/__tests__/__snapshots__/AmeliproTileBtn.spec.ts.snap +74 -0
- package/src/components/Amelipro/AmeliproTooltips/__tests__/AmeliproTooltips.spec.ts +212 -0
- package/src/components/Amelipro/AmeliproTooltips/__tests__/__snapshots__/AmeliproTooltips.spec.ts.snap +71 -0
- package/src/components/Amelipro/AmeliproTransmission/__tests__/AmeliproTransmission.spec.ts +155 -0
- package/src/components/Amelipro/AmeliproTransmission/__tests__/__snapshots__/AmeliproTransmission.spec.ts.snap +240 -0
- package/src/components/Amelipro/AmeliproUpload/AmeliproUpload.stories.ts +0 -1
- package/src/components/Amelipro/ServiceMenu/tests/__snapshots__/ServiceMenu.spec.ts.snap +4 -1
- package/src/components/Amelipro/StructureMenu/StructureBtn/StructureBtn.vue +4 -0
- package/src/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.vue +4 -5
- package/src/components/Amelipro/StructureMenu/StructureTabs/tests/__snapshots__/StructureTabs.spec.ts.snap +5 -4
- package/src/components/Amelipro/StructureMenu/tests/__snapshots__/StructureMenu.spec.ts.snap +13 -6
- package/src/components/Amelipro/UserMenu/UserMenu.vue +2 -1
- package/src/components/Amelipro/UserMenu/tests/__snapshots__/UserMenu.spec.ts.snap +4 -1
- package/src/components/Captcha/Captcha.mdx +4 -4
- package/src/components/Captcha/Captcha.stories.ts +8 -1
- package/src/components/Captcha/Captcha.vue +3 -0
- package/src/components/Captcha/CaptchaBase.vue +3 -0
- package/src/components/Captcha/captchaApi.ts +0 -1
- package/src/components/Customs/Selects/SySelect/SySelect.vue +2 -2
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +5 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +1 -1
- package/src/components/Customs/SyTabs/SyTabs.stories.ts +174 -10
- package/src/components/Customs/SyTabs/SyTabs.vue +62 -0
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +98 -0
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +13 -13
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +13 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +11 -11
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +5 -0
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.mdx +7 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.range.spec.ts +1 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.spec.ts +3 -3
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +50 -2
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +15 -15
- package/src/components/DatePicker/composables/tests/useDateFormatValidation.spec.ts +2 -2
- package/src/components/DatePicker/composables/tests/useManualDateValidation.spec.ts +1 -1
- package/src/components/DatePicker/composables/useDateFormatDisplay.ts +25 -0
- package/src/components/DatePicker/composables/useDateFormatValidation.ts +5 -2
- package/src/components/DatePicker/composables/useManualDateValidation.ts +5 -1
- package/src/components/DatePicker/tests/DatePicker.validation.spec.ts +1 -1
- package/src/components/ErrorPage/ErrorPage.vue +54 -7
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +6 -2
- package/src/components/ExternalLinks/ExternalLinks.vue +2 -4
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +6 -2
- package/src/components/PasswordField/PasswordField.vue +6 -6
- package/src/components/RangeField/RangeSlider/RangeSlider.vue +3 -2
- package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +2 -1
- package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +2 -0
- package/src/components/RatingPicker/RatingPicker.stories.ts +10 -0
- package/src/components/RatingPicker/RatingPicker.vue +23 -1
- package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +2 -0
- package/src/components/SearchListField/Accessibilite.stories.ts +4 -0
- package/src/components/SearchListField/SearchListField.stories.ts +16 -0
- package/src/components/SearchListField/SearchListField.vue +121 -109
- package/src/components/SearchListField/locales.ts +11 -2
- package/src/components/SearchListField/tests/SearchListField.spec.ts +91 -25
- package/src/components/SyAlert/SyAlert.vue +8 -0
- package/src/components/SyAlert/tests/SyAlert.spec.ts +1 -22
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +304 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +12 -4
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +67 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +186 -0
- package/src/components/Tables/SyTable/SyTable.vue +12 -4
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +65 -1
- package/src/components/Tables/common/types.ts +2 -0
- package/src/composables/rules/useFieldValidation.ts +47 -7
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproLogoAm/tests/AmeliproLogoAm.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproIcon/tests/AmeliproIcon.spec.ts +0 -19
- package/src/components/Amelipro/AmeliproIconBtn/tests/AmeliproIconBtn.spec.ts +0 -22
- package/src/components/Amelipro/AmeliproIconBtn/tests/__snapshots__/AmeliproIconBtn.spec.ts.snap +0 -87
- package/src/components/Amelipro/AmeliproIllustratedDataTile/tests/AmeliproIllustratedDataTile.spec.ts +0 -20
- package/src/components/Amelipro/AmeliproIllustratedDataTile/tests/__snapshots__/AmeliproIllustratedDataTile.spec.ts.snap +0 -69
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/tests/AmeliproIllustratedRadioGroup.spec.ts +0 -53
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/tests/__snapshots__/AmeliproIllustratedRadioGroup.spec.ts.snap +0 -544
- package/src/components/Amelipro/AmeliproMailTile/tests/AmeliproMailTile.spec.ts +0 -25
- package/src/components/Amelipro/AmeliproMailTile/tests/__snapshots__/AmeliproMailTile.spec.ts.snap +0 -164
- package/src/components/Amelipro/AmeliproMessage/tests/AmeliproMessage.spec.ts +0 -18
- package/src/components/Amelipro/AmeliproMessage/tests/__snapshots__/AmeliproMessage.spec.ts.snap +0 -94
- package/src/components/Amelipro/AmeliproMessagingLayout/tests/AmeliproMessagingLayout.spec.ts +0 -30
- package/src/components/Amelipro/AmeliproMessagingLayout/tests/__snapshots__/AmeliproMessagingLayout.spec.ts.snap +0 -439
- package/src/components/Amelipro/AmeliproNumberedCard/tests/AmeliproNumberedCard.spec.ts +0 -23
- package/src/components/Amelipro/AmeliproOnboarding/tests/AmeliproOnboarding.spec.ts +0 -41
- package/src/components/Amelipro/AmeliproOnboarding/tests/__snapshots__/AmeliproOnboarding.spec.ts.snap +0 -3
- package/src/components/Amelipro/AmeliproPageLayout/tests/AmeliproPageLayout.spec.ts +0 -183
- package/src/components/Amelipro/AmeliproPageLayout/tests/__snapshots__/AmeliproPageLayout.spec.ts.snap +0 -1602
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/tests/AmeliproPaginationBtn.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/tests/__snapshots__/AmeliproPaginationBtn.spec.ts.snap +0 -46
- package/src/components/Amelipro/AmeliproPagination/tests/AmeliproPagination.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproPagination/tests/__snapshots__/AmeliproPagination.spec.ts.snap +0 -116
- package/src/components/Amelipro/AmeliproPatientBanner/tests/AmeliproPatientBanner.spec.ts +0 -24
- package/src/components/Amelipro/AmeliproPatientBanner/tests/__snapshots__/AmeliproPatientBanner.spec.ts.snap +0 -268
- package/src/components/Amelipro/AmeliproRadioGroup/tests/AmeliproRadioGroup.spec.ts +0 -43
- package/src/components/Amelipro/AmeliproRadioGroup/tests/__snapshots__/AmeliproRadioGroup.spec.ts.snap +0 -262
- package/src/components/Amelipro/AmeliproSelect/tests/AmeliproSelect.spec.ts +0 -38
- package/src/components/Amelipro/AmeliproSelect/tests/__snapshots__/AmeliproSelect.spec.ts.snap +0 -196
- package/src/components/Amelipro/AmeliproStateTile/tests/AmeliproStateTile.spec.ts +0 -20
- package/src/components/Amelipro/AmeliproStateTile/tests/__snapshots__/AmeliproStateTile.spec.ts.snap +0 -90
- package/src/components/Amelipro/AmeliproStatus/tests/AmeliproStatus.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproStatus/tests/__snapshots__/AmeliproStatus.spec.ts.snap +0 -21
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/tests/AmeliproStepBtn.spec.ts +0 -18
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/tests/__snapshots__/AmeliproStepBtn.spec.ts.snap +0 -34
- package/src/components/Amelipro/AmeliproStepper/tests/AmeliproStepper.spec.ts +0 -36
- package/src/components/Amelipro/AmeliproStepper/tests/__snapshots__/AmeliproStepper.spec.ts.snap +0 -354
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/tests/AmeliproTabBtn.spec.ts +0 -20
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/tests/__snapshots__/AmeliproTabBtn.spec.ts.snap +0 -34
- package/src/components/Amelipro/AmeliproTabs/tests/AmeliproTabs.spec.ts +0 -39
- package/src/components/Amelipro/AmeliproTabs/tests/__snapshots__/AmeliproTabs.spec.ts.snap +0 -217
- package/src/components/Amelipro/AmeliproTextField/tests/AmeliproTextField.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproTextField/tests/__snapshots__/AmeliproTextField.spec.ts.snap +0 -162
- package/src/components/Amelipro/AmeliproTileBtn/tests/AmeliproTileBtn.spec.ts +0 -17
- package/src/components/Amelipro/AmeliproTileBtn/tests/__snapshots__/AmeliproTileBtn.spec.ts.snap +0 -65
- package/src/components/Amelipro/AmeliproTooltips/tests/AmeliproTooltips.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproTooltips/tests/__snapshots__/AmeliproTooltips.spec.ts.snap +0 -105
- package/src/components/Amelipro/AmeliproTransmission/tests/AmeliproTransmission.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproTransmission/tests/__snapshots__/AmeliproTransmission.spec.ts.snap +0 -246
- package/src/components/SyAlert/tests/__snapshots__/SyAlert.spec.ts.snap +0 -99
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
2
|
import { ref, watch } from 'vue'
|
|
3
3
|
import AmeliproRadioGroup from './AmeliproRadioGroup.vue'
|
|
4
|
+
// --- LabelInfo ---
|
|
5
|
+
import AmeliproTooltips from '../AmeliproTooltips/AmeliproTooltips.vue'
|
|
6
|
+
import AmeliproBtn from '../AmeliproBtn/AmeliproBtn.vue'
|
|
4
7
|
|
|
5
8
|
const meta = {
|
|
6
9
|
argTypes: {
|
|
@@ -213,6 +216,7 @@ export const Required: Story = {
|
|
|
213
216
|
group-label="Sélection obligatoire"
|
|
214
217
|
unique-id="radio-required"
|
|
215
218
|
aria-required
|
|
219
|
+
:error="true"
|
|
216
220
|
/>
|
|
217
221
|
</template>`,
|
|
218
222
|
},
|
|
@@ -227,16 +231,24 @@ export const Required: Story = {
|
|
|
227
231
|
],
|
|
228
232
|
},
|
|
229
233
|
render: args => ({
|
|
230
|
-
components: { AmeliproRadioGroup },
|
|
234
|
+
components: { AmeliproRadioGroup, AmeliproBtn },
|
|
231
235
|
setup() {
|
|
232
236
|
const model = ref(args.modelValue)
|
|
233
237
|
watch(() => args.modelValue, (newValue) => {
|
|
234
238
|
model.value = newValue
|
|
235
239
|
})
|
|
236
|
-
|
|
240
|
+
const deselect = () => {
|
|
241
|
+
model.value = model.value.map(item => ({
|
|
242
|
+
...item,
|
|
243
|
+
isChecked: false,
|
|
244
|
+
}))
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return { args, model, deselect }
|
|
237
248
|
},
|
|
238
249
|
template: `<p class="mb-2">La sélection d’un bouton est obligatoire grâce à la prop <code>ariaRequired</code>.</p>
|
|
239
|
-
<AmeliproRadioGroup v-bind="args" v-model="model"
|
|
250
|
+
<AmeliproRadioGroup v-bind="args" v-model="model"/>
|
|
251
|
+
<AmeliproBtn class="mt-4" @click="deselect">Tout désélectionner</AmeliproBtn>`,
|
|
240
252
|
}),
|
|
241
253
|
}
|
|
242
254
|
|
|
@@ -248,6 +260,7 @@ export const RequiredErrorMessage: Story = {
|
|
|
248
260
|
uniqueId: 'radio-errormsg',
|
|
249
261
|
ariaRequired: true,
|
|
250
262
|
requiredErrorMessage: 'Veuillez sélectionner une option',
|
|
263
|
+
error: true,
|
|
251
264
|
},
|
|
252
265
|
parameters: {
|
|
253
266
|
sourceCode: [
|
|
@@ -260,6 +273,7 @@ export const RequiredErrorMessage: Story = {
|
|
|
260
273
|
group-label="Erreur personnalisée"
|
|
261
274
|
unique-id="radio-errormsg"
|
|
262
275
|
aria-required
|
|
276
|
+
:error="true"
|
|
263
277
|
required-error-message="Veuillez sélectionner une option"
|
|
264
278
|
/>
|
|
265
279
|
</template>`,
|
|
@@ -275,16 +289,24 @@ export const RequiredErrorMessage: Story = {
|
|
|
275
289
|
],
|
|
276
290
|
},
|
|
277
291
|
render: args => ({
|
|
278
|
-
components: { AmeliproRadioGroup },
|
|
292
|
+
components: { AmeliproRadioGroup, AmeliproBtn },
|
|
279
293
|
setup() {
|
|
280
294
|
const model = ref(args.modelValue)
|
|
281
295
|
watch(() => args.modelValue, (newValue) => {
|
|
282
296
|
model.value = newValue
|
|
283
297
|
})
|
|
284
|
-
|
|
298
|
+
|
|
299
|
+
const deselect = () => {
|
|
300
|
+
model.value = model.value.map(item => ({
|
|
301
|
+
...item,
|
|
302
|
+
isChecked: false,
|
|
303
|
+
}))
|
|
304
|
+
}
|
|
305
|
+
return { args, model, deselect }
|
|
285
306
|
},
|
|
286
307
|
template: `<p class="mb-2">Message d’erreur personnalisé via la prop <code>requiredErrorMessage</code>.</p>
|
|
287
|
-
<AmeliproRadioGroup v-bind="args" v-model="model"
|
|
308
|
+
<AmeliproRadioGroup v-bind="args" v-model="model"/>
|
|
309
|
+
<AmeliproBtn class="mt-4" @click="deselect">Tout désélectionner</AmeliproBtn>`,
|
|
288
310
|
}),
|
|
289
311
|
}
|
|
290
312
|
|
|
@@ -518,8 +540,6 @@ export const HiddenLabel: Story = {
|
|
|
518
540
|
}),
|
|
519
541
|
}
|
|
520
542
|
|
|
521
|
-
// --- LabelInfo ---
|
|
522
|
-
import AmeliproTooltips from '../AmeliproTooltips/AmeliproTooltips.vue'
|
|
523
543
|
export const LabelInfo: Story = {
|
|
524
544
|
args: {
|
|
525
545
|
groupLabel: 'Label avec info-bulle',
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { VueWrapper, mount, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
3
|
+
import { AmeliproMessage } from '@/components'
|
|
4
|
+
import AmeliproRadioGroup from '../AmeliproRadioGroup.vue'
|
|
5
|
+
import type { AmeliproRadioGroupItem } from '../types'
|
|
6
|
+
import type { ComponentProps } from 'vue-component-type-helpers'
|
|
7
|
+
import type { ExpectedPropOptions } from '@tests/types'
|
|
8
|
+
import { type PropType } from 'vue'
|
|
9
|
+
import TestHelper from '@tests/helpers/TestHelper'
|
|
10
|
+
|
|
11
|
+
const expectedPropOptions: ExpectedPropOptions<typeof AmeliproRadioGroup> = {
|
|
12
|
+
ariaRequired: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false,
|
|
19
|
+
},
|
|
20
|
+
error: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false,
|
|
23
|
+
},
|
|
24
|
+
fullHorizontal: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
groupLabel: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: '',
|
|
31
|
+
},
|
|
32
|
+
hiddenLabel: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false,
|
|
35
|
+
},
|
|
36
|
+
horizontal: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
horizontalLabel: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
44
|
+
modelValue: {
|
|
45
|
+
type: Array as PropType<AmeliproRadioGroupItem[]>,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
pills: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
52
|
+
requiredErrorMessage: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: 'Ce champ est obligatoire',
|
|
55
|
+
},
|
|
56
|
+
uniqueId: {
|
|
57
|
+
type: String,
|
|
58
|
+
required: true,
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Values pour les props "required"
|
|
63
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproRadioGroup> => ({
|
|
64
|
+
modelValue: [],
|
|
65
|
+
uniqueId: 'required-unique-id',
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
// Valeurs pour les props "modified"
|
|
69
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproRadioGroup> => ({
|
|
70
|
+
ariaRequired: true,
|
|
71
|
+
disabled: true,
|
|
72
|
+
error: true,
|
|
73
|
+
fullHorizontal: true,
|
|
74
|
+
groupLabel: 'Modified group label',
|
|
75
|
+
hiddenLabel: true,
|
|
76
|
+
horizontal: true,
|
|
77
|
+
horizontalLabel: false,
|
|
78
|
+
modelValue: [
|
|
79
|
+
{
|
|
80
|
+
isChecked: false,
|
|
81
|
+
label: 'Modified item label 1',
|
|
82
|
+
value: 'modified-item-value-1',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
isChecked: true,
|
|
86
|
+
label: 'Modified item label 2',
|
|
87
|
+
value: 'modified-item-value-2',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
isChecked: false,
|
|
91
|
+
label: 'Modified item label 3',
|
|
92
|
+
value: 'modified-item-value-3',
|
|
93
|
+
},
|
|
94
|
+
] as AmeliproRadioGroupItem[],
|
|
95
|
+
pills: true,
|
|
96
|
+
requiredErrorMessage: 'Modified required error message',
|
|
97
|
+
uniqueId: 'modified-unique-id',
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
const reset = [
|
|
101
|
+
{
|
|
102
|
+
isChecked: false,
|
|
103
|
+
label: 'Modified item label 1',
|
|
104
|
+
value: 'modified-item-value-1',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
isChecked: false,
|
|
108
|
+
label: 'Modified item label 2',
|
|
109
|
+
value: 'modified-item-value-2',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
isChecked: false,
|
|
113
|
+
label: 'Modified item label 3',
|
|
114
|
+
value: 'modified-item-value-3',
|
|
115
|
+
},
|
|
116
|
+
] as AmeliproRadioGroupItem[]
|
|
117
|
+
|
|
118
|
+
const testHelper = new TestHelper(AmeliproRadioGroup)
|
|
119
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
120
|
+
.setRequiredPropValues(requiredPropValues)
|
|
121
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
122
|
+
|
|
123
|
+
describe('AmeliproRadioGroup', () => {
|
|
124
|
+
describe('Snapshots', () => {
|
|
125
|
+
testHelper.snapshots()
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
describe('Properties', () => {
|
|
129
|
+
testHelper.properties()
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
describe('Events', () => {
|
|
133
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproRadioGroup>>
|
|
134
|
+
const inputFinder = () => vueWrapper.findAll('.radio-group__item__label input')
|
|
135
|
+
|
|
136
|
+
beforeEach(() => {
|
|
137
|
+
vueWrapper = shallowMount(AmeliproRadioGroup, { props: { ...requiredPropValues(), modelValue: testHelper.modified('modelValue') } })
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
it('should test the input vueWrapper', () => {
|
|
141
|
+
expect(inputFinder().length).toBe(3)
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
it('should react to change:selected event', async () => {
|
|
145
|
+
expect(vueWrapper.emitted('change:selected')).toBeUndefined()
|
|
146
|
+
|
|
147
|
+
await inputFinder().at(0)?.trigger('input')
|
|
148
|
+
expect(vueWrapper.emitted('change:selected')).toStrictEqual([[
|
|
149
|
+
'modified-item-value-1',
|
|
150
|
+
]])
|
|
151
|
+
|
|
152
|
+
await inputFinder().at(1)?.trigger('input')
|
|
153
|
+
expect(vueWrapper.emitted('change:selected')).toStrictEqual([
|
|
154
|
+
[
|
|
155
|
+
'modified-item-value-1',
|
|
156
|
+
],
|
|
157
|
+
[
|
|
158
|
+
'modified-item-value-2',
|
|
159
|
+
],
|
|
160
|
+
])
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
describe('classes', () => {
|
|
165
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproRadioGroup>>
|
|
166
|
+
|
|
167
|
+
beforeEach(() => {
|
|
168
|
+
vueWrapper = shallowMount(AmeliproRadioGroup, { props: { ...requiredPropValues(), modelValue: testHelper.modified('modelValue') } })
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
// group Classes
|
|
172
|
+
it('should update radio-group classes', async () => {
|
|
173
|
+
const elementWrapper = vueWrapper.find('.radio-group')
|
|
174
|
+
expect(elementWrapper.attributes('class')).toBe('d-flex flex-column radio-group')
|
|
175
|
+
|
|
176
|
+
await vueWrapper.setProps({ horizontal: true })
|
|
177
|
+
expect(elementWrapper.attributes('class')).toBe('d-flex flex-column radio-group')
|
|
178
|
+
|
|
179
|
+
await vueWrapper.setProps({ horizontal: false, fullHorizontal: true })
|
|
180
|
+
expect(elementWrapper.attributes('class')).toBe('d-flex flex-column radio-group flex-md-row align-md-center')
|
|
181
|
+
|
|
182
|
+
await vueWrapper.setProps({ fullHorizontal: false, horizontal: false, horizontalLabel: true })
|
|
183
|
+
expect(elementWrapper.attributes('class')).toBe('d-flex flex-column radio-group flex-md-row align-md-start')
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
// radioGroupClasses
|
|
187
|
+
it('should update radio-group__list classes', async () => {
|
|
188
|
+
const elementWrapper = vueWrapper.find('.radio-group__list')
|
|
189
|
+
expect(elementWrapper.attributes('class')).toBe('d-flex flex-wrap list-style-none radio-group__list flex-column')
|
|
190
|
+
|
|
191
|
+
await vueWrapper.setProps({ horizontal: true })
|
|
192
|
+
expect(elementWrapper.attributes('class')).toBe('d-flex flex-wrap list-style-none radio-group__list flex-column flex-md-row align-md-center')
|
|
193
|
+
|
|
194
|
+
await vueWrapper.setProps({ horizontal: false, fullHorizontal: true })
|
|
195
|
+
expect(elementWrapper.attributes('class')).toBe('d-flex flex-wrap list-style-none radio-group__list flex-column flex-md-row align-md-center')
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
// radio Group Classes for pills version
|
|
199
|
+
it('should update radio-group__list classes for pills version', async () => {
|
|
200
|
+
await vueWrapper.setProps({ pills: true })
|
|
201
|
+
const elementWrapper = vueWrapper.find('.radio-group__list')
|
|
202
|
+
expect(elementWrapper.attributes('class')).toBe('d-flex flex-wrap list-style-none radio-group__list')
|
|
203
|
+
|
|
204
|
+
await vueWrapper.setProps({ horizontal: true })
|
|
205
|
+
expect(elementWrapper.attributes('class')).toBe('d-flex flex-wrap list-style-none radio-group__list flex-md-row align-md-center')
|
|
206
|
+
|
|
207
|
+
await vueWrapper.setProps({ horizontal: false, fullHorizontal: true })
|
|
208
|
+
expect(elementWrapper.attributes('class')).toBe('d-flex flex-wrap list-style-none radio-group__list flex-md-row align-md-center')
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
// label Color Classes
|
|
212
|
+
it('should update radio label classes', async () => {
|
|
213
|
+
const spanWrappers = vueWrapper.findAll('input + span')
|
|
214
|
+
expect(spanWrappers.at(0)?.attributes('class')).toBe('text-ap-grey-darken-1')
|
|
215
|
+
|
|
216
|
+
await vueWrapper.setProps({ disabled: true })
|
|
217
|
+
expect(spanWrappers.at(0)?.attributes('class')).toBe('text-ap-grey')
|
|
218
|
+
|
|
219
|
+
await vueWrapper.setProps({ ariaRequired: true, disabled: false, error: true, modelValue: reset })
|
|
220
|
+
expect(spanWrappers.at(0)?.attributes('class')).toBe('text-ap-red radio-group__item-label-span-error')
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
// label Color Classes for pills version
|
|
224
|
+
it('should update radio label classes for pills version', async () => {
|
|
225
|
+
await vueWrapper.setProps({ pills: true })
|
|
226
|
+
const spanWrappers = vueWrapper.findAll('.radio-group__item__label > span')
|
|
227
|
+
expect(spanWrappers.at(0)?.attributes('class')).toBe('text-ap-blue-darken-1')
|
|
228
|
+
|
|
229
|
+
await vueWrapper.setProps({ disabled: true })
|
|
230
|
+
expect(spanWrappers.at(0)?.attributes('class')).toBe('text-ap-grey-darken-1')
|
|
231
|
+
|
|
232
|
+
await vueWrapper.setProps({ ariaRequired: true, disabled: false, error: true, modelValue: reset })
|
|
233
|
+
expect(spanWrappers.at(0)?.attributes('class')).toBe('text-ap-red radio-group__item-label-span-error')
|
|
234
|
+
})
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
// TODO: réparer ces tests
|
|
238
|
+
describe.skip('Slots', () => {
|
|
239
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproRadioGroup>>
|
|
240
|
+
const inputFinder = () => vueWrapper.findAll('.radio-group__item__label input')
|
|
241
|
+
const subItemsWrapper = (index: number) => vueWrapper.find(`#${modifiedPropValues().uniqueId}-subitem-${index}`)
|
|
242
|
+
|
|
243
|
+
beforeEach(() => {
|
|
244
|
+
vueWrapper = mount(AmeliproRadioGroup, {
|
|
245
|
+
props: { ...requiredPropValues(), modelValue: testHelper.modified('modelValue') },
|
|
246
|
+
slots: {
|
|
247
|
+
'subItem-0': '<p>subItem 0</p>',
|
|
248
|
+
'subItem-1': '<p>subItem 1</p>',
|
|
249
|
+
},
|
|
250
|
+
stubs: { AmeliproMessage },
|
|
251
|
+
})
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
it('should test slots and aria-controls', async () => {
|
|
255
|
+
// test case for item with slot but fullHorizontal or Horizontal is true
|
|
256
|
+
await inputFinder().at(0)?.trigger('input')
|
|
257
|
+
await vueWrapper.setProps({ fullHorizontal: true })
|
|
258
|
+
expect(subItemsWrapper(0).exists()).toBe(false)
|
|
259
|
+
expect(inputFinder().at(0)?.attributes('aria-controls')).toBeUndefined()
|
|
260
|
+
|
|
261
|
+
// test case for checked item with slot
|
|
262
|
+
await vueWrapper.setProps({ fullHorizontal: false })
|
|
263
|
+
expect(subItemsWrapper(0).exists()).toBe(true)
|
|
264
|
+
expect(inputFinder().at(0)?.attributes('aria-controls')).toBe('the-group-id-subitem-0')
|
|
265
|
+
// test case for item which is not checked
|
|
266
|
+
expect(subItemsWrapper(1).exists()).toBe(false)
|
|
267
|
+
expect(inputFinder().at(1)?.attributes('aria-controls')).toBe('the-group-id-subitem-1')
|
|
268
|
+
// test case for item without slot
|
|
269
|
+
expect(subItemsWrapper(2).exists()).toBe(false)
|
|
270
|
+
expect(inputFinder().at(2)?.attributes('aria-controls')).toBeUndefined()
|
|
271
|
+
})
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
// TODO: réparer ces tests
|
|
275
|
+
describe.skip('attributes', () => {
|
|
276
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproRadioGroup>>
|
|
277
|
+
const inputFinder = () => vueWrapper.findAll('.radio-group__item__label input')
|
|
278
|
+
|
|
279
|
+
beforeEach(() => {
|
|
280
|
+
vueWrapper = shallowMount(AmeliproRadioGroup, {
|
|
281
|
+
props: modifiedPropValues(),
|
|
282
|
+
slots: {
|
|
283
|
+
'subItem-0': '<p>subItem 0</p>',
|
|
284
|
+
'subItem-1': '<p>subItem 1</p>',
|
|
285
|
+
},
|
|
286
|
+
})
|
|
287
|
+
})
|
|
288
|
+
|
|
289
|
+
it('should test the input vueWrapper', () => {
|
|
290
|
+
expect(inputFinder().length).toBe(3)
|
|
291
|
+
})
|
|
292
|
+
|
|
293
|
+
it('should test aria-expanded value', async () => {
|
|
294
|
+
await inputFinder().at(0)?.trigger('input')
|
|
295
|
+
await vueWrapper.vm.$nextTick()
|
|
296
|
+
|
|
297
|
+
// test case for item slot opened
|
|
298
|
+
expect(inputFinder().at(0)?.attributes('aria-expanded')).toBe('true')
|
|
299
|
+
// test case for item slot closed
|
|
300
|
+
expect(inputFinder().at(1)?.attributes('aria-expanded')).toBe('false')
|
|
301
|
+
// test case for item without slot
|
|
302
|
+
expect(inputFinder().at(2)?.attributes('aria-expanded')).toBe(undefined)
|
|
303
|
+
})
|
|
304
|
+
})
|
|
305
|
+
|
|
306
|
+
describe('errors', () => {
|
|
307
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproRadioGroup>>
|
|
308
|
+
const inputFinder = () => vueWrapper.findAll('.radio-group__item__label input')
|
|
309
|
+
|
|
310
|
+
beforeEach(() => {
|
|
311
|
+
vueWrapper = shallowMount(AmeliproRadioGroup, { props: requiredPropValues() })
|
|
312
|
+
})
|
|
313
|
+
|
|
314
|
+
it('should display error message', async () => {
|
|
315
|
+
let componentWrapper = vueWrapper.findComponent(AmeliproMessage)
|
|
316
|
+
expect(componentWrapper.exists()).toBe(false)
|
|
317
|
+
|
|
318
|
+
await vueWrapper.setProps({ ariaRequired: true, error: true, modelValue: reset })
|
|
319
|
+
await vueWrapper.vm.$nextTick()
|
|
320
|
+
|
|
321
|
+
expect(inputFinder().at(0)?.attributes('aria-describedby')).toBe('required-unique-id-error')
|
|
322
|
+
expect(inputFinder().at(1)?.attributes('aria-describedby')).toBe('required-unique-id-error')
|
|
323
|
+
expect(inputFinder().at(2)?.attributes('aria-describedby')).toBe('required-unique-id-error')
|
|
324
|
+
|
|
325
|
+
componentWrapper = vueWrapper.findComponent(AmeliproMessage)
|
|
326
|
+
expect(componentWrapper.exists()).toBe(true)
|
|
327
|
+
|
|
328
|
+
// TODO: ce test ne marche plus car le contenu de AmeliproMessage est vide (slot non rendu)
|
|
329
|
+
// expect(componentWrapper.find('.mb-0').text()).toBe('Ce champ est obligatoire');
|
|
330
|
+
})
|
|
331
|
+
})
|
|
332
|
+
})
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`AmeliproRadioGroup > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
class="
|
|
6
|
+
amelipro-radio-group
|
|
7
|
+
pills
|
|
8
|
+
"
|
|
9
|
+
id="modified-unique-id-container"
|
|
10
|
+
>
|
|
11
|
+
<div class="
|
|
12
|
+
align-md-center
|
|
13
|
+
d-flex
|
|
14
|
+
flex-column
|
|
15
|
+
flex-md-row
|
|
16
|
+
radio-group
|
|
17
|
+
">
|
|
18
|
+
<div class="
|
|
19
|
+
align-center
|
|
20
|
+
d-flex
|
|
21
|
+
mr-2
|
|
22
|
+
radio-group__label-wrapper
|
|
23
|
+
">
|
|
24
|
+
<p
|
|
25
|
+
class="
|
|
26
|
+
d-inline-flex
|
|
27
|
+
d-sr-only
|
|
28
|
+
margin-label
|
|
29
|
+
mb-0
|
|
30
|
+
mb-md-4
|
|
31
|
+
radio-group__label
|
|
32
|
+
"
|
|
33
|
+
id="modified-unique-id"
|
|
34
|
+
>
|
|
35
|
+
Modified group label
|
|
36
|
+
<span
|
|
37
|
+
aria-hidden="true"
|
|
38
|
+
class="d-inline-flex"
|
|
39
|
+
>
|
|
40
|
+
*
|
|
41
|
+
</span>
|
|
42
|
+
<span class="d-sr-only">
|
|
43
|
+
Champ obligatoire
|
|
44
|
+
</span>
|
|
45
|
+
</p>
|
|
46
|
+
</div>
|
|
47
|
+
<div
|
|
48
|
+
aria-labelledby="modified-unique-id"
|
|
49
|
+
aria-required="true"
|
|
50
|
+
class="
|
|
51
|
+
mt-2
|
|
52
|
+
radio-group__wrapper
|
|
53
|
+
"
|
|
54
|
+
role="radiogroup"
|
|
55
|
+
>
|
|
56
|
+
<ul
|
|
57
|
+
class="
|
|
58
|
+
align-md-center
|
|
59
|
+
d-flex
|
|
60
|
+
flex-md-row
|
|
61
|
+
flex-wrap
|
|
62
|
+
list-style-none
|
|
63
|
+
radio-group__list
|
|
64
|
+
"
|
|
65
|
+
id="modified-unique-id-list"
|
|
66
|
+
>
|
|
67
|
+
<li
|
|
68
|
+
class="
|
|
69
|
+
mb-2
|
|
70
|
+
radio-group__item
|
|
71
|
+
"
|
|
72
|
+
id="modified-unique-id-item-0"
|
|
73
|
+
>
|
|
74
|
+
<div class="
|
|
75
|
+
align-center
|
|
76
|
+
amelipro-radio-group__label-wrapper
|
|
77
|
+
d-flex
|
|
78
|
+
mr-2
|
|
79
|
+
">
|
|
80
|
+
<label
|
|
81
|
+
class="
|
|
82
|
+
align-center
|
|
83
|
+
d-inline-flex
|
|
84
|
+
flex-row
|
|
85
|
+
mr-0
|
|
86
|
+
radio-group__item__label
|
|
87
|
+
text-body-1
|
|
88
|
+
"
|
|
89
|
+
id="modified-unique-id-label-0"
|
|
90
|
+
>
|
|
91
|
+
<input
|
|
92
|
+
aria-checked="false"
|
|
93
|
+
disabled=""
|
|
94
|
+
id="modified-unique-id-input-0"
|
|
95
|
+
name="modified-unique-id-name"
|
|
96
|
+
required=""
|
|
97
|
+
type="radio"
|
|
98
|
+
value="modified-item-value-1"
|
|
99
|
+
/>
|
|
100
|
+
<span
|
|
101
|
+
class="text-ap-grey-darken-1"
|
|
102
|
+
id="modified-unique-id-label-text-0"
|
|
103
|
+
>
|
|
104
|
+
Modified item label 1
|
|
105
|
+
</span>
|
|
106
|
+
</label>
|
|
107
|
+
</div>
|
|
108
|
+
<!-- v-if -->
|
|
109
|
+
</li>
|
|
110
|
+
<li
|
|
111
|
+
class="
|
|
112
|
+
mb-2
|
|
113
|
+
radio-group__item
|
|
114
|
+
"
|
|
115
|
+
id="modified-unique-id-item-1"
|
|
116
|
+
>
|
|
117
|
+
<div class="
|
|
118
|
+
align-center
|
|
119
|
+
amelipro-radio-group__label-wrapper
|
|
120
|
+
d-flex
|
|
121
|
+
mr-2
|
|
122
|
+
">
|
|
123
|
+
<label
|
|
124
|
+
class="
|
|
125
|
+
align-center
|
|
126
|
+
d-inline-flex
|
|
127
|
+
flex-row
|
|
128
|
+
mr-0
|
|
129
|
+
radio-group__item__label
|
|
130
|
+
text-body-1
|
|
131
|
+
"
|
|
132
|
+
id="modified-unique-id-label-1"
|
|
133
|
+
>
|
|
134
|
+
<input
|
|
135
|
+
aria-checked="true"
|
|
136
|
+
checked=""
|
|
137
|
+
disabled=""
|
|
138
|
+
id="modified-unique-id-input-1"
|
|
139
|
+
name="modified-unique-id-name"
|
|
140
|
+
required=""
|
|
141
|
+
type="radio"
|
|
142
|
+
value="modified-item-value-2"
|
|
143
|
+
/>
|
|
144
|
+
<span
|
|
145
|
+
class="text-ap-grey-darken-1"
|
|
146
|
+
id="modified-unique-id-label-text-1"
|
|
147
|
+
>
|
|
148
|
+
Modified item label 2
|
|
149
|
+
</span>
|
|
150
|
+
</label>
|
|
151
|
+
</div>
|
|
152
|
+
<!-- v-if -->
|
|
153
|
+
</li>
|
|
154
|
+
<li
|
|
155
|
+
class="
|
|
156
|
+
mb-2
|
|
157
|
+
radio-group__item
|
|
158
|
+
"
|
|
159
|
+
id="modified-unique-id-item-2"
|
|
160
|
+
>
|
|
161
|
+
<div class="
|
|
162
|
+
align-center
|
|
163
|
+
amelipro-radio-group__label-wrapper
|
|
164
|
+
d-flex
|
|
165
|
+
mr-2
|
|
166
|
+
">
|
|
167
|
+
<label
|
|
168
|
+
class="
|
|
169
|
+
align-center
|
|
170
|
+
d-inline-flex
|
|
171
|
+
flex-row
|
|
172
|
+
mr-0
|
|
173
|
+
radio-group__item__label
|
|
174
|
+
text-body-1
|
|
175
|
+
"
|
|
176
|
+
id="modified-unique-id-label-2"
|
|
177
|
+
>
|
|
178
|
+
<input
|
|
179
|
+
aria-checked="false"
|
|
180
|
+
disabled=""
|
|
181
|
+
id="modified-unique-id-input-2"
|
|
182
|
+
name="modified-unique-id-name"
|
|
183
|
+
required=""
|
|
184
|
+
type="radio"
|
|
185
|
+
value="modified-item-value-3"
|
|
186
|
+
/>
|
|
187
|
+
<span
|
|
188
|
+
class="text-ap-grey-darken-1"
|
|
189
|
+
id="modified-unique-id-label-text-2"
|
|
190
|
+
>
|
|
191
|
+
Modified item label 3
|
|
192
|
+
</span>
|
|
193
|
+
</label>
|
|
194
|
+
</div>
|
|
195
|
+
<!-- v-if -->
|
|
196
|
+
</li>
|
|
197
|
+
</ul>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
<!-- v-if -->
|
|
201
|
+
</div>
|
|
202
|
+
`;
|
|
203
|
+
|
|
204
|
+
exports[`AmeliproRadioGroup > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
205
|
+
<div
|
|
206
|
+
class="
|
|
207
|
+
amelipro-radio-group
|
|
208
|
+
classic
|
|
209
|
+
"
|
|
210
|
+
id="required-unique-id-container"
|
|
211
|
+
>
|
|
212
|
+
<div class="
|
|
213
|
+
d-flex
|
|
214
|
+
flex-column
|
|
215
|
+
radio-group
|
|
216
|
+
">
|
|
217
|
+
<div class="
|
|
218
|
+
align-center
|
|
219
|
+
d-flex
|
|
220
|
+
mr-2
|
|
221
|
+
radio-group__label-wrapper
|
|
222
|
+
">
|
|
223
|
+
<p
|
|
224
|
+
class="
|
|
225
|
+
d-inline-flex
|
|
226
|
+
mb-1
|
|
227
|
+
radio-group__label
|
|
228
|
+
"
|
|
229
|
+
id="required-unique-id"
|
|
230
|
+
>
|
|
231
|
+
<!-- v-if -->
|
|
232
|
+
<!-- v-if -->
|
|
233
|
+
</p>
|
|
234
|
+
</div>
|
|
235
|
+
<div
|
|
236
|
+
aria-labelledby="required-unique-id"
|
|
237
|
+
aria-required="false"
|
|
238
|
+
class="radio-group__wrapper"
|
|
239
|
+
role="radiogroup"
|
|
240
|
+
>
|
|
241
|
+
<ul
|
|
242
|
+
class="
|
|
243
|
+
d-flex
|
|
244
|
+
flex-column
|
|
245
|
+
flex-wrap
|
|
246
|
+
list-style-none
|
|
247
|
+
radio-group__list
|
|
248
|
+
"
|
|
249
|
+
id="required-unique-id-list"
|
|
250
|
+
></ul>
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
<!-- v-if -->
|
|
254
|
+
</div>
|
|
255
|
+
`;
|
|
@@ -261,7 +261,6 @@ export const Default: Story = {
|
|
|
261
261
|
</AmeliproCard>
|
|
262
262
|
</template>
|
|
263
263
|
</AmeliproResultList>
|
|
264
|
-
<button @click="toto()"
|
|
265
264
|
</div>
|
|
266
265
|
`,
|
|
267
266
|
}),
|
|
@@ -297,7 +296,7 @@ export const PaginationEtTri: Story = {
|
|
|
297
296
|
title="Avec pagination et tri"
|
|
298
297
|
:items-to-display-desktop="4"
|
|
299
298
|
:items-to-display-mobile="2"
|
|
300
|
-
sort-select-default-value="
|
|
299
|
+
sort-select-default-value="desc"
|
|
301
300
|
:sort-select-items="[
|
|
302
301
|
{ title: 'Nom croissant', value: 'asc' },
|
|
303
302
|
{ title: 'Nom décroissant', value: 'desc' }
|