@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
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { VueWrapper, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
3
|
+
import AmeliproStateTile from '../AmeliproStateTile.vue'
|
|
4
|
+
import type { AmeliproStateTileTypes } from '../AmeliproStateTileTypes'
|
|
5
|
+
import type { ComponentProps } from 'vue-component-type-helpers'
|
|
6
|
+
import type { ExpectedPropOptions } from '@tests/types'
|
|
7
|
+
import type { PropType } from 'vue'
|
|
8
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
9
|
+
import TestHelper from '@tests/helpers/TestHelper'
|
|
10
|
+
|
|
11
|
+
const expectedPropOptions: ExpectedPropOptions<typeof AmeliproStateTile> = {
|
|
12
|
+
btnStyledText: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: undefined,
|
|
15
|
+
},
|
|
16
|
+
contentMinHeight: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: '284px',
|
|
19
|
+
},
|
|
20
|
+
disabled: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false,
|
|
23
|
+
},
|
|
24
|
+
href: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: undefined,
|
|
27
|
+
},
|
|
28
|
+
labelFirstLine: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: undefined,
|
|
31
|
+
},
|
|
32
|
+
labelSecondLine: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: undefined,
|
|
35
|
+
},
|
|
36
|
+
labelThirdLine: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: undefined,
|
|
39
|
+
},
|
|
40
|
+
linkStyleText: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'Consulter',
|
|
43
|
+
},
|
|
44
|
+
noPdfIcon: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
48
|
+
tileMinHeight: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: undefined,
|
|
51
|
+
},
|
|
52
|
+
tilePaddingX: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: '24px',
|
|
55
|
+
},
|
|
56
|
+
tileType: {
|
|
57
|
+
default: 'toDo',
|
|
58
|
+
type: String as PropType<keyof typeof AmeliproStateTileTypes>,
|
|
59
|
+
validator(value: string): boolean {
|
|
60
|
+
return ['date', 'done', 'doneNoCertificate', 'doneNoCertificateBlue', 'doneToCorrect', 'optionnal', 'toDo', 'toDoNoCertificate', 'toDoNoCertificateBlue'].includes(value)
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
tileWidth: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: '100%',
|
|
66
|
+
},
|
|
67
|
+
to: {
|
|
68
|
+
type: [Array, Object, String] as PropType<RouteLocationRaw>,
|
|
69
|
+
default: undefined,
|
|
70
|
+
},
|
|
71
|
+
uniqueId: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: undefined,
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproStateTile> => ({})
|
|
78
|
+
|
|
79
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproStateTile> => ({
|
|
80
|
+
btnStyledText: 'Modified styled text',
|
|
81
|
+
contentMinHeight: '300px',
|
|
82
|
+
disabled: true,
|
|
83
|
+
href: '/modified-href',
|
|
84
|
+
labelFirstLine: 'Modified first line',
|
|
85
|
+
labelSecondLine: 'Modified second line',
|
|
86
|
+
labelThirdLine: 'Modified third line',
|
|
87
|
+
linkStyleText: 'Modified link style text',
|
|
88
|
+
noPdfIcon: true,
|
|
89
|
+
tileMinHeight: '350px',
|
|
90
|
+
tilePaddingX: '32px',
|
|
91
|
+
tileType: 'done',
|
|
92
|
+
tileWidth: '80%',
|
|
93
|
+
to: '/modified-to',
|
|
94
|
+
uniqueId: 'modified-unique-id',
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
const globalStubs = {
|
|
98
|
+
VBtn: {
|
|
99
|
+
props: [
|
|
100
|
+
'uniqueId',
|
|
101
|
+
'disabled',
|
|
102
|
+
'href',
|
|
103
|
+
'tileMinHeight',
|
|
104
|
+
'tileStyles',
|
|
105
|
+
'to',
|
|
106
|
+
'tileWidth',
|
|
107
|
+
],
|
|
108
|
+
template: `<button
|
|
109
|
+
:id="uniqueId"
|
|
110
|
+
class="amelipro-state-tile text-none text-h5"
|
|
111
|
+
:disabled="disabled"
|
|
112
|
+
:href="href"
|
|
113
|
+
:min-height="tileMinHeight"
|
|
114
|
+
:style="tileStyles"
|
|
115
|
+
:to="to"
|
|
116
|
+
:width="tileWidth"
|
|
117
|
+
@click="emitClickEvent && emitClickEvent()"
|
|
118
|
+
><slot /></button>`,
|
|
119
|
+
},
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const testHelper = new TestHelper(AmeliproStateTile)
|
|
123
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
124
|
+
.setRequiredPropValues(requiredPropValues)
|
|
125
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
126
|
+
.setMountOptions({ global: { stubs: globalStubs } })
|
|
127
|
+
|
|
128
|
+
describe('AmeliproStateTile', () => {
|
|
129
|
+
describe('Snapshots', () => {
|
|
130
|
+
testHelper.snapshots()
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
describe('Properties', () => {
|
|
134
|
+
testHelper.properties()
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
describe('Setting props should update attributes of inner tags', () => {
|
|
138
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproStateTile>>
|
|
139
|
+
|
|
140
|
+
beforeEach(() => {
|
|
141
|
+
vueWrapper = shallowMount(AmeliproStateTile, { props: requiredPropValues(), global: { stubs: globalStubs } })
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
145
|
+
expect(vueWrapper.find('.amelipro-state-tile').attributes('id')).toBeUndefined()
|
|
146
|
+
|
|
147
|
+
const { uniqueId } = modifiedPropValues()
|
|
148
|
+
await vueWrapper.setProps({ uniqueId })
|
|
149
|
+
expect(vueWrapper.find('.amelipro-state-tile').attributes('id')).toBe(testHelper.modified('uniqueId'))
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
it('prop labelFirstLine sets first line content', async () => {
|
|
153
|
+
expect(vueWrapper.find('.amelipro-state-tile__first-line').text()).toBe('')
|
|
154
|
+
|
|
155
|
+
const { labelFirstLine } = modifiedPropValues()
|
|
156
|
+
await vueWrapper.setProps({ labelFirstLine })
|
|
157
|
+
expect(vueWrapper.find('.amelipro-state-tile__first-line').text()).toBe(testHelper.modified('labelFirstLine'))
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
it('prop labelSecondLine sets second line content', async () => {
|
|
161
|
+
expect(vueWrapper.find('.amelipro-state-tile__second-line').exists()).toBe(false)
|
|
162
|
+
|
|
163
|
+
const { labelSecondLine } = modifiedPropValues()
|
|
164
|
+
await vueWrapper.setProps({ labelSecondLine })
|
|
165
|
+
expect(vueWrapper.find('.amelipro-state-tile__second-line').text()).toBe(testHelper.modified('labelSecondLine'))
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
it('prop labelThirdLine sets third line content', async () => {
|
|
169
|
+
expect(vueWrapper.find('.amelipro-state-tile__third-line').exists()).toBe(false)
|
|
170
|
+
|
|
171
|
+
const { labelThirdLine } = modifiedPropValues()
|
|
172
|
+
await vueWrapper.setProps({ labelThirdLine })
|
|
173
|
+
expect(vueWrapper.find('.amelipro-state-tile__third-line').text()).toBe(testHelper.modified('labelThirdLine'))
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
it('prop btnStyledText sets styled button text', async () => {
|
|
177
|
+
expect(vueWrapper.find('.btn-styled-text').exists()).toBe(false)
|
|
178
|
+
|
|
179
|
+
const { btnStyledText } = modifiedPropValues()
|
|
180
|
+
await vueWrapper.setProps({ btnStyledText, disabled: false })
|
|
181
|
+
expect(vueWrapper.find('.btn-styled-text').text()).toBe(testHelper.modified('btnStyledText'))
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
it('prop disabled sets unavailable text', async () => {
|
|
185
|
+
expect(vueWrapper.find('.amelipro-state-tile__unavailable').exists()).toBe(false)
|
|
186
|
+
|
|
187
|
+
const { disabled } = modifiedPropValues()
|
|
188
|
+
await vueWrapper.setProps({ disabled })
|
|
189
|
+
expect(vueWrapper.find('.amelipro-state-tile__unavailable').exists()).toBe(true)
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
describe('Events', () => {
|
|
194
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproStateTile>>
|
|
195
|
+
|
|
196
|
+
beforeEach(() => {
|
|
197
|
+
vueWrapper = shallowMount(AmeliproStateTile, { props: { ...requiredPropValues(), uniqueId: 'event-id' } })
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
it('emit click event when tile is clicked', async () => {
|
|
201
|
+
await vueWrapper.find('.amelipro-state-tile').trigger('click')
|
|
202
|
+
expect(vueWrapper.emitted('click')).toBeTruthy()
|
|
203
|
+
expect(vueWrapper.emitted('click')?.[0]).toEqual(['event-id'])
|
|
204
|
+
})
|
|
205
|
+
})
|
|
206
|
+
})
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`AmeliproStateTile > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
|
+
<button
|
|
5
|
+
class="
|
|
6
|
+
amelipro-state-tile
|
|
7
|
+
text-h5
|
|
8
|
+
text-none
|
|
9
|
+
"
|
|
10
|
+
disabled=""
|
|
11
|
+
elevation="0"
|
|
12
|
+
height="auto"
|
|
13
|
+
href="/modified-href"
|
|
14
|
+
id="modified-unique-id"
|
|
15
|
+
min-height="350px"
|
|
16
|
+
ripple="false"
|
|
17
|
+
style="
|
|
18
|
+
background-color: #DDDEDE !important;
|
|
19
|
+
border: 2px solid #545859 !important;
|
|
20
|
+
border-radius: 0.5rem;
|
|
21
|
+
color: #1A1B1B !important;
|
|
22
|
+
padding: 0px;
|
|
23
|
+
min-height: 350px;
|
|
24
|
+
"
|
|
25
|
+
to="/modified-to"
|
|
26
|
+
width="80%"
|
|
27
|
+
>
|
|
28
|
+
<span
|
|
29
|
+
class="
|
|
30
|
+
amelipro-state-tile__content
|
|
31
|
+
d-flex
|
|
32
|
+
flex-column
|
|
33
|
+
justify-center
|
|
34
|
+
w-100
|
|
35
|
+
"
|
|
36
|
+
style="
|
|
37
|
+
padding: 32px;
|
|
38
|
+
min-height: 300px;
|
|
39
|
+
"
|
|
40
|
+
>
|
|
41
|
+
<span class="
|
|
42
|
+
amelipro-state-tile__text
|
|
43
|
+
d-flex
|
|
44
|
+
flex-column
|
|
45
|
+
justify-center
|
|
46
|
+
text-center
|
|
47
|
+
w-100
|
|
48
|
+
">
|
|
49
|
+
<span
|
|
50
|
+
class="
|
|
51
|
+
amelipro-state-tile__first-line
|
|
52
|
+
d-block
|
|
53
|
+
text-center
|
|
54
|
+
text-h5
|
|
55
|
+
"
|
|
56
|
+
id="modified-unique-id-first-line"
|
|
57
|
+
>
|
|
58
|
+
Modified first line
|
|
59
|
+
</span>
|
|
60
|
+
<span
|
|
61
|
+
class="
|
|
62
|
+
amelipro-state-tile__second-line
|
|
63
|
+
d-block
|
|
64
|
+
text-center
|
|
65
|
+
text-h5
|
|
66
|
+
"
|
|
67
|
+
id="modified-unique-id-second-line"
|
|
68
|
+
>
|
|
69
|
+
Modified second line
|
|
70
|
+
</span>
|
|
71
|
+
<span
|
|
72
|
+
class="
|
|
73
|
+
amelipro-state-tile__third-line
|
|
74
|
+
d-block
|
|
75
|
+
mt-6
|
|
76
|
+
text-body-1
|
|
77
|
+
text-center
|
|
78
|
+
"
|
|
79
|
+
id="modified-unique-id-third-line"
|
|
80
|
+
>
|
|
81
|
+
Modified third line
|
|
82
|
+
</span>
|
|
83
|
+
</span>
|
|
84
|
+
<span>
|
|
85
|
+
<span
|
|
86
|
+
class="
|
|
87
|
+
amelipro-state-tile__unavailable
|
|
88
|
+
d-block
|
|
89
|
+
font-weight-bold
|
|
90
|
+
mt-6
|
|
91
|
+
text-center
|
|
92
|
+
"
|
|
93
|
+
id="modified-unique-id-unavailable-text"
|
|
94
|
+
>
|
|
95
|
+
Non disponible
|
|
96
|
+
</span>
|
|
97
|
+
</span>
|
|
98
|
+
<!-- v-if -->
|
|
99
|
+
</span>
|
|
100
|
+
</button>
|
|
101
|
+
`;
|
|
102
|
+
|
|
103
|
+
exports[`AmeliproStateTile > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
104
|
+
<button
|
|
105
|
+
class="
|
|
106
|
+
amelipro-state-tile
|
|
107
|
+
text-h5
|
|
108
|
+
text-none
|
|
109
|
+
"
|
|
110
|
+
elevation="0"
|
|
111
|
+
height="auto"
|
|
112
|
+
ripple="false"
|
|
113
|
+
style="
|
|
114
|
+
background-color: #00749C;
|
|
115
|
+
border: 2px solid #00749C !important;
|
|
116
|
+
border-radius: 0.5rem;
|
|
117
|
+
color: #FFFFFF;
|
|
118
|
+
padding: 0px;
|
|
119
|
+
"
|
|
120
|
+
width="100%"
|
|
121
|
+
>
|
|
122
|
+
<span
|
|
123
|
+
class="
|
|
124
|
+
amelipro-state-tile__content
|
|
125
|
+
d-flex
|
|
126
|
+
flex-column
|
|
127
|
+
justify-center
|
|
128
|
+
w-100
|
|
129
|
+
"
|
|
130
|
+
style="
|
|
131
|
+
padding: 32px 24px;
|
|
132
|
+
min-height: 284px;
|
|
133
|
+
"
|
|
134
|
+
>
|
|
135
|
+
<span class="
|
|
136
|
+
amelipro-state-tile__text
|
|
137
|
+
d-flex
|
|
138
|
+
flex-column
|
|
139
|
+
justify-center
|
|
140
|
+
text-center
|
|
141
|
+
w-100
|
|
142
|
+
">
|
|
143
|
+
<span class="
|
|
144
|
+
amelipro-state-tile__first-line
|
|
145
|
+
d-block
|
|
146
|
+
text-center
|
|
147
|
+
text-h5
|
|
148
|
+
"></span>
|
|
149
|
+
<!-- v-if -->
|
|
150
|
+
<!-- v-if -->
|
|
151
|
+
</span>
|
|
152
|
+
<span>
|
|
153
|
+
<!-- v-if -->
|
|
154
|
+
</span>
|
|
155
|
+
<!-- v-if -->
|
|
156
|
+
</span>
|
|
157
|
+
</button>
|
|
158
|
+
`;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { VueWrapper, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
3
|
+
import AmeliproStatus from '../AmeliproStatus.vue'
|
|
4
|
+
import type { AmeliproStatusTypes } from '../AmeliproStatusTypes'
|
|
5
|
+
import type { ComponentProps } from 'vue-component-type-helpers'
|
|
6
|
+
import type { ExpectedPropOptions } from '@tests/types'
|
|
7
|
+
import type { PropType } from 'vue'
|
|
8
|
+
import TestHelper from '@tests/helpers/TestHelper'
|
|
9
|
+
|
|
10
|
+
const expectedPropOptions: ExpectedPropOptions<typeof AmeliproStatus> = {
|
|
11
|
+
isSpan: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false,
|
|
14
|
+
},
|
|
15
|
+
label: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: undefined,
|
|
18
|
+
},
|
|
19
|
+
paddingX: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: '12px',
|
|
22
|
+
},
|
|
23
|
+
paddingY: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: '4px',
|
|
26
|
+
},
|
|
27
|
+
type: {
|
|
28
|
+
default: 'draft',
|
|
29
|
+
type: String as PropType<keyof typeof AmeliproStatusTypes>,
|
|
30
|
+
validator(value: string): boolean {
|
|
31
|
+
return ['action', 'archive', 'canceled', 'closed', 'draft', 'failure', 'progress', 'success'].includes(value.toLowerCase())
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
uniqueId: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: undefined,
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Values pour les props "required"
|
|
41
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproStatus> => ({})
|
|
42
|
+
|
|
43
|
+
// Valeurs pour les props "modified"
|
|
44
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproStatus> => ({
|
|
45
|
+
isSpan: true,
|
|
46
|
+
label: 'Modified label',
|
|
47
|
+
paddingX: '16px',
|
|
48
|
+
paddingY: '15px',
|
|
49
|
+
type: 'canceled',
|
|
50
|
+
uniqueId: 'modified-unique-id',
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const testHelper = new TestHelper(AmeliproStatus)
|
|
54
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
55
|
+
.setRequiredPropValues(requiredPropValues)
|
|
56
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
57
|
+
|
|
58
|
+
describe('AmeliproStatus', () => {
|
|
59
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproStatus>>
|
|
60
|
+
|
|
61
|
+
describe('Snapshots', () => {
|
|
62
|
+
testHelper.snapshots()
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
describe('Properties', () => {
|
|
66
|
+
testHelper.properties()
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
describe('Setting props should update attributes of inner tags', () => {
|
|
70
|
+
beforeEach(() => {
|
|
71
|
+
vueWrapper = shallowMount(AmeliproStatus, { props: requiredPropValues() })
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
describe('main tag', () => {
|
|
75
|
+
it('prop isSpan sets type of tag', async () => {
|
|
76
|
+
expect(vueWrapper.findAll('p').length).toBe(1)
|
|
77
|
+
expect(vueWrapper.findAll('span').length).toBe(0)
|
|
78
|
+
|
|
79
|
+
const { isSpan } = modifiedPropValues()
|
|
80
|
+
await vueWrapper.setProps({ isSpan })
|
|
81
|
+
expect(vueWrapper.findAll('p').length).toBe(0)
|
|
82
|
+
expect(vueWrapper.findAll('span').length).toBe(1)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
it('props label & type sets text content', async () => {
|
|
86
|
+
expect(vueWrapper.find('p').text()).toBe('Brouillon')
|
|
87
|
+
|
|
88
|
+
const { type } = modifiedPropValues()
|
|
89
|
+
await vueWrapper.setProps({ type })
|
|
90
|
+
expect(vueWrapper.find('p').text()).toBe('Annulé')
|
|
91
|
+
|
|
92
|
+
const { label } = modifiedPropValues()
|
|
93
|
+
await vueWrapper.setProps({ label })
|
|
94
|
+
expect(vueWrapper.find('p').text()).toBe('Modified label')
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it('props paddingX, paddingY & type sets component style', async () => {
|
|
98
|
+
expect(vueWrapper.find('p').attributes('style')).toBe('border: 2px solid transparent; border-radius: 16px; padding: 4px 12px;')
|
|
99
|
+
|
|
100
|
+
const { paddingX, paddingY } = modifiedPropValues()
|
|
101
|
+
await vueWrapper.setProps({ paddingX, paddingY })
|
|
102
|
+
expect(vueWrapper.find('p').attributes('style')).toBe('border: 2px solid transparent; border-radius: 16px; padding: 15px 16px;')
|
|
103
|
+
|
|
104
|
+
// TODO: type 'canceled' => borderColor: 'bg-ap-grey-lighten-1' => pourquoi #000 ?
|
|
105
|
+
const { type } = modifiedPropValues()
|
|
106
|
+
await vueWrapper.setProps({ type })
|
|
107
|
+
expect(vueWrapper.find('p').attributes('style')).toBe('border: 2px solid #000; border-radius: 16px; padding: 15px 16px;')
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
it('prop type sets component classes', async () => {
|
|
111
|
+
expect(vueWrapper.find('p').classes('bg-ap-yellow-lighten-3')).toBe(true)
|
|
112
|
+
expect(vueWrapper.find('p').classes('bg-ap-red-lighten-3')).toBe(false)
|
|
113
|
+
|
|
114
|
+
await vueWrapper.setProps({ type: 'progress' })
|
|
115
|
+
expect(vueWrapper.find('p').classes('bg-ap-yellow-lighten-3')).toBe(false)
|
|
116
|
+
expect(vueWrapper.find('p').classes('bg-ap-red-lighten-3')).toBe(true)
|
|
117
|
+
})
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
})
|
package/src/components/Amelipro/AmeliproStatus/__tests__/__snapshots__/AmeliproStatus.spec.ts.snap
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`AmeliproStatus > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
|
+
<span
|
|
5
|
+
class="
|
|
6
|
+
amelipro-status
|
|
7
|
+
d-inline-flex
|
|
8
|
+
font-weight-bold
|
|
9
|
+
mb-0
|
|
10
|
+
"
|
|
11
|
+
id="modified-unique-id"
|
|
12
|
+
style="
|
|
13
|
+
border: 2px solid #000;
|
|
14
|
+
border-radius: 16px;
|
|
15
|
+
padding: 15px 16px;
|
|
16
|
+
"
|
|
17
|
+
>
|
|
18
|
+
Modified label
|
|
19
|
+
</span>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`AmeliproStatus > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
23
|
+
<p
|
|
24
|
+
class="
|
|
25
|
+
amelipro-status
|
|
26
|
+
bg-ap-yellow-lighten-3
|
|
27
|
+
d-inline-flex
|
|
28
|
+
font-weight-bold
|
|
29
|
+
mb-0
|
|
30
|
+
"
|
|
31
|
+
style="
|
|
32
|
+
border: 2px solid transparent;
|
|
33
|
+
border-radius: 16px;
|
|
34
|
+
padding: 4px 12px;
|
|
35
|
+
"
|
|
36
|
+
>
|
|
37
|
+
Brouillon
|
|
38
|
+
</p>
|
|
39
|
+
`;
|
package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/__tests__/AmeliproStepBtn.spec.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { VueWrapper, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
3
|
+
import AmeliproStepBtn from '../AmeliproStepBtn.vue'
|
|
4
|
+
import type { ComponentProps } from 'vue-component-type-helpers'
|
|
5
|
+
import type { ExpectedPropOptions } from '@tests/types'
|
|
6
|
+
import TestHelper from '@tests/helpers/TestHelper'
|
|
7
|
+
|
|
8
|
+
const expectedPropOptions: ExpectedPropOptions<typeof AmeliproStepBtn> = {
|
|
9
|
+
disabled: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false,
|
|
12
|
+
},
|
|
13
|
+
isActive: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
uniqueId: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: undefined,
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Values pour les props "required"
|
|
24
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproStepBtn> => ({})
|
|
25
|
+
|
|
26
|
+
// Valeurs pour les props "modified"
|
|
27
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproStepBtn> => ({
|
|
28
|
+
disabled: true,
|
|
29
|
+
isActive: true,
|
|
30
|
+
uniqueId: 'modified-unique-id',
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const testHelper = new TestHelper(AmeliproStepBtn)
|
|
34
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
35
|
+
.setRequiredPropValues(requiredPropValues)
|
|
36
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
37
|
+
|
|
38
|
+
describe('AmeliproStepBtn', () => {
|
|
39
|
+
describe('Snapshots', () => {
|
|
40
|
+
testHelper.snapshots()
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
describe('Properties', () => {
|
|
44
|
+
testHelper.properties()
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
describe('Setting props should update props or attributes of inner tags', () => {
|
|
48
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproStepBtn>>
|
|
49
|
+
|
|
50
|
+
beforeEach(() => {
|
|
51
|
+
vueWrapper = shallowMount(AmeliproStepBtn, { props: requiredPropValues() })
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it('prop isActive sets aria current', async () => {
|
|
55
|
+
expect(vueWrapper.find('.amelipro-step-btn').attributes('aria-current')).toBeUndefined()
|
|
56
|
+
|
|
57
|
+
const { isActive } = modifiedPropValues()
|
|
58
|
+
await vueWrapper.setProps({ isActive })
|
|
59
|
+
expect(vueWrapper.find('.amelipro-step-btn').attributes('aria-current')).toBe('step')
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
it('prop disabled sets attribute disabled', async () => {
|
|
63
|
+
expect(vueWrapper.find('.amelipro-step-btn').attributes('disabled')).toBeUndefined()
|
|
64
|
+
|
|
65
|
+
const { disabled } = modifiedPropValues()
|
|
66
|
+
await vueWrapper.setProps({ disabled })
|
|
67
|
+
expect(vueWrapper.find('.amelipro-step-btn').attributes('disabled')).toBe('')
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('props disabled && isActive sets button style', async () => {
|
|
71
|
+
expect(vueWrapper.find('.amelipro-step-btn').attributes('style')).toBe('background-color: #E6F6FC; border: 1px solid #DDDEDE; color: #00749C; position: relative; z-index: 1;')
|
|
72
|
+
|
|
73
|
+
await vueWrapper.setProps({ disabled: true, isActive: true })
|
|
74
|
+
expect(vueWrapper.find('.amelipro-step-btn').attributes('style')).toBe('background-color: #E6F6FC; border: 1px solid #DDDEDE; color: #00749C; position: relative; z-index: 1;')
|
|
75
|
+
|
|
76
|
+
await vueWrapper.setProps({ disabled: false, isActive: true })
|
|
77
|
+
expect(vueWrapper.find('.amelipro-step-btn').attributes('style')).toBe('background-color: #00749C; border: 1px solid #00749C; color: #FFFFFF; position: relative; z-index: 1;')
|
|
78
|
+
|
|
79
|
+
await vueWrapper.setProps({ disabled: true, isActive: false })
|
|
80
|
+
expect(vueWrapper.find('.amelipro-step-btn').attributes('style')).toBe('background-color: #DDDEDE; border: 1px solid #DDDEDE; color: #1A1B1B; position: relative; z-index: 1; cursor: default;')
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
describe('Events', () => {
|
|
85
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproStepBtn>>
|
|
86
|
+
|
|
87
|
+
beforeEach(() => {
|
|
88
|
+
vueWrapper = shallowMount(AmeliproStepBtn, { props: requiredPropValues() })
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
it('emits an event when the button is clicked', () => {
|
|
92
|
+
expect(vueWrapper.emitted('click')).toBeUndefined()
|
|
93
|
+
vueWrapper.find('button').trigger('click')
|
|
94
|
+
expect(vueWrapper.emitted('click')).toEqual([[]])
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
})
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`AmeliproStepBtn > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
|
+
<button
|
|
5
|
+
aria-current="step"
|
|
6
|
+
class="
|
|
7
|
+
amelipro-step-btn
|
|
8
|
+
pb-4
|
|
9
|
+
pt-3
|
|
10
|
+
px-4
|
|
11
|
+
text-subtitle-1
|
|
12
|
+
"
|
|
13
|
+
disabled=""
|
|
14
|
+
id="modified-unique-id"
|
|
15
|
+
role="tab"
|
|
16
|
+
style="
|
|
17
|
+
background-color: #E6F6FC;
|
|
18
|
+
border: 1px solid #DDDEDE;
|
|
19
|
+
color: #00749C;
|
|
20
|
+
position: relative;
|
|
21
|
+
z-index: 1;
|
|
22
|
+
"
|
|
23
|
+
type="button"
|
|
24
|
+
>
|
|
25
|
+
<span
|
|
26
|
+
class="
|
|
27
|
+
align-center
|
|
28
|
+
amelipro-step-btn__content
|
|
29
|
+
d-flex
|
|
30
|
+
"
|
|
31
|
+
id="modified-unique-id-content"
|
|
32
|
+
></span>
|
|
33
|
+
</button>
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
exports[`AmeliproStepBtn > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
37
|
+
<button
|
|
38
|
+
class="
|
|
39
|
+
amelipro-step-btn
|
|
40
|
+
pb-4
|
|
41
|
+
pt-3
|
|
42
|
+
px-4
|
|
43
|
+
text-subtitle-1
|
|
44
|
+
"
|
|
45
|
+
role="tab"
|
|
46
|
+
style="
|
|
47
|
+
background-color: #E6F6FC;
|
|
48
|
+
border: 1px solid #DDDEDE;
|
|
49
|
+
color: #00749C;
|
|
50
|
+
position: relative;
|
|
51
|
+
z-index: 1;
|
|
52
|
+
"
|
|
53
|
+
type="button"
|
|
54
|
+
>
|
|
55
|
+
<span class="
|
|
56
|
+
align-center
|
|
57
|
+
amelipro-step-btn__content
|
|
58
|
+
d-flex
|
|
59
|
+
"></span>
|
|
60
|
+
</button>
|
|
61
|
+
`;
|