@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,325 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`AmeliproIllustratedRadioGroup > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
class="amelipro-illustrated-radio-group"
|
|
6
|
+
id="modified-unique-id-container"
|
|
7
|
+
>
|
|
8
|
+
<div>
|
|
9
|
+
<div
|
|
10
|
+
class="
|
|
11
|
+
align-center
|
|
12
|
+
amelipro-illustrated-radio-group__label-wrapper
|
|
13
|
+
d-flex
|
|
14
|
+
mr-2
|
|
15
|
+
"
|
|
16
|
+
id="modified-unique-id-label-group"
|
|
17
|
+
>
|
|
18
|
+
<p
|
|
19
|
+
class="
|
|
20
|
+
amelipro-illustrated-radio-group__label
|
|
21
|
+
d-inline-flex
|
|
22
|
+
mb-0
|
|
23
|
+
"
|
|
24
|
+
id="modified-unique-id"
|
|
25
|
+
>
|
|
26
|
+
Modified group label
|
|
27
|
+
<span
|
|
28
|
+
aria-hidden="true"
|
|
29
|
+
class="d-inline-flex"
|
|
30
|
+
>
|
|
31
|
+
*
|
|
32
|
+
</span>
|
|
33
|
+
<span class="d-sr-only">
|
|
34
|
+
Champ obligatoire
|
|
35
|
+
</span>
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
<div
|
|
39
|
+
aria-labelledby="modified-unique-id"
|
|
40
|
+
aria-required="true"
|
|
41
|
+
class="
|
|
42
|
+
amelipro-illustrated-radio-group__group
|
|
43
|
+
mt-2
|
|
44
|
+
"
|
|
45
|
+
role="radiogroup"
|
|
46
|
+
>
|
|
47
|
+
<ul
|
|
48
|
+
class="
|
|
49
|
+
amelipro-illustrated-radio-group__list
|
|
50
|
+
d-flex
|
|
51
|
+
flex-wrap
|
|
52
|
+
list-style-none
|
|
53
|
+
"
|
|
54
|
+
id="modified-unique-id-list"
|
|
55
|
+
>
|
|
56
|
+
<li
|
|
57
|
+
class="amelipro-illustrated-radio-group__item"
|
|
58
|
+
id="modified-unique-id-item-0"
|
|
59
|
+
>
|
|
60
|
+
<label
|
|
61
|
+
class="
|
|
62
|
+
align-center
|
|
63
|
+
amelipro-illustrated-radio-group__item__label
|
|
64
|
+
d-inline-flex
|
|
65
|
+
flex-row
|
|
66
|
+
mb-2
|
|
67
|
+
mr-2
|
|
68
|
+
"
|
|
69
|
+
for="modified-unique-id-input-0"
|
|
70
|
+
id="modified-unique-id-label-0"
|
|
71
|
+
>
|
|
72
|
+
<input
|
|
73
|
+
aria-checked="false"
|
|
74
|
+
aria-describedby="modified-unique-id-error"
|
|
75
|
+
disabled=""
|
|
76
|
+
id="modified-unique-id-input-0"
|
|
77
|
+
name="modified-unique-id-name"
|
|
78
|
+
required=""
|
|
79
|
+
type="radio"
|
|
80
|
+
value="the-item-value-1"
|
|
81
|
+
/>
|
|
82
|
+
<span class="
|
|
83
|
+
align-center
|
|
84
|
+
amelipro-illustrated-radio-group__item__label__content
|
|
85
|
+
d-flex
|
|
86
|
+
flex-column
|
|
87
|
+
">
|
|
88
|
+
<span class="
|
|
89
|
+
align-center
|
|
90
|
+
bg-ap-blue-lighten-3
|
|
91
|
+
d-flex
|
|
92
|
+
flex-column
|
|
93
|
+
icon-radio__wrapper
|
|
94
|
+
pa-4
|
|
95
|
+
">
|
|
96
|
+
<amelipro-icon-stub
|
|
97
|
+
bordered="false"
|
|
98
|
+
icon="vaccination"
|
|
99
|
+
iconbgcolor="transparent"
|
|
100
|
+
iconcolor="ap-yellow"
|
|
101
|
+
large="false"
|
|
102
|
+
medium="false"
|
|
103
|
+
size="modified-icon-size"
|
|
104
|
+
small="false"
|
|
105
|
+
uniqueid="modified-unique-id-icon-0"
|
|
106
|
+
widthauto="false"
|
|
107
|
+
xlarge="false"
|
|
108
|
+
></amelipro-icon-stub>
|
|
109
|
+
<span
|
|
110
|
+
class="
|
|
111
|
+
amelipro-illustrated-radio-group__item-label-text
|
|
112
|
+
mt-4
|
|
113
|
+
text-ap-blue-darken-1
|
|
114
|
+
"
|
|
115
|
+
id="modified-unique-id-label-text-0"
|
|
116
|
+
>
|
|
117
|
+
the item label 1
|
|
118
|
+
</span>
|
|
119
|
+
</span>
|
|
120
|
+
</span>
|
|
121
|
+
</label>
|
|
122
|
+
</li>
|
|
123
|
+
<li
|
|
124
|
+
class="amelipro-illustrated-radio-group__item"
|
|
125
|
+
id="modified-unique-id-item-1"
|
|
126
|
+
>
|
|
127
|
+
<label
|
|
128
|
+
class="
|
|
129
|
+
align-center
|
|
130
|
+
amelipro-illustrated-radio-group__item__label
|
|
131
|
+
d-inline-flex
|
|
132
|
+
flex-row
|
|
133
|
+
mb-2
|
|
134
|
+
mr-2
|
|
135
|
+
"
|
|
136
|
+
for="modified-unique-id-input-1"
|
|
137
|
+
id="modified-unique-id-label-1"
|
|
138
|
+
>
|
|
139
|
+
<input
|
|
140
|
+
aria-checked="false"
|
|
141
|
+
aria-describedby="modified-unique-id-error"
|
|
142
|
+
disabled=""
|
|
143
|
+
id="modified-unique-id-input-1"
|
|
144
|
+
name="modified-unique-id-name"
|
|
145
|
+
required=""
|
|
146
|
+
type="radio"
|
|
147
|
+
value="the-item-value-2"
|
|
148
|
+
/>
|
|
149
|
+
<span class="
|
|
150
|
+
align-center
|
|
151
|
+
amelipro-illustrated-radio-group__item__label__content
|
|
152
|
+
d-flex
|
|
153
|
+
flex-column
|
|
154
|
+
">
|
|
155
|
+
<span class="
|
|
156
|
+
align-center
|
|
157
|
+
bg-ap-blue-lighten-3
|
|
158
|
+
d-flex
|
|
159
|
+
flex-column
|
|
160
|
+
icon-radio__wrapper
|
|
161
|
+
pa-4
|
|
162
|
+
">
|
|
163
|
+
<amelipro-icon-stub
|
|
164
|
+
bordered="false"
|
|
165
|
+
icon="vaccination"
|
|
166
|
+
iconbgcolor="transparent"
|
|
167
|
+
iconcolor="ap-green"
|
|
168
|
+
large="false"
|
|
169
|
+
medium="false"
|
|
170
|
+
size="modified-icon-size"
|
|
171
|
+
small="false"
|
|
172
|
+
uniqueid="modified-unique-id-icon-1"
|
|
173
|
+
widthauto="false"
|
|
174
|
+
xlarge="false"
|
|
175
|
+
></amelipro-icon-stub>
|
|
176
|
+
<span
|
|
177
|
+
class="
|
|
178
|
+
amelipro-illustrated-radio-group__item-label-text
|
|
179
|
+
mt-4
|
|
180
|
+
text-ap-blue-darken-1
|
|
181
|
+
"
|
|
182
|
+
id="modified-unique-id-label-text-1"
|
|
183
|
+
>
|
|
184
|
+
the item label 2
|
|
185
|
+
</span>
|
|
186
|
+
</span>
|
|
187
|
+
</span>
|
|
188
|
+
</label>
|
|
189
|
+
</li>
|
|
190
|
+
<li
|
|
191
|
+
class="amelipro-illustrated-radio-group__item"
|
|
192
|
+
id="modified-unique-id-item-2"
|
|
193
|
+
>
|
|
194
|
+
<label
|
|
195
|
+
class="
|
|
196
|
+
align-center
|
|
197
|
+
amelipro-illustrated-radio-group__item__label
|
|
198
|
+
d-inline-flex
|
|
199
|
+
flex-row
|
|
200
|
+
mb-2
|
|
201
|
+
mr-2
|
|
202
|
+
"
|
|
203
|
+
for="modified-unique-id-input-2"
|
|
204
|
+
id="modified-unique-id-label-2"
|
|
205
|
+
>
|
|
206
|
+
<input
|
|
207
|
+
aria-checked="false"
|
|
208
|
+
aria-describedby="modified-unique-id-error"
|
|
209
|
+
disabled=""
|
|
210
|
+
id="modified-unique-id-input-2"
|
|
211
|
+
name="modified-unique-id-name"
|
|
212
|
+
required=""
|
|
213
|
+
type="radio"
|
|
214
|
+
value="the-item-value-3"
|
|
215
|
+
/>
|
|
216
|
+
<span class="
|
|
217
|
+
align-center
|
|
218
|
+
amelipro-illustrated-radio-group__item__label__content
|
|
219
|
+
d-flex
|
|
220
|
+
flex-column
|
|
221
|
+
">
|
|
222
|
+
<span class="
|
|
223
|
+
align-center
|
|
224
|
+
bg-ap-blue-lighten-3
|
|
225
|
+
d-flex
|
|
226
|
+
flex-column
|
|
227
|
+
icon-radio__wrapper
|
|
228
|
+
pa-4
|
|
229
|
+
">
|
|
230
|
+
<amelipro-icon-stub
|
|
231
|
+
bordered="false"
|
|
232
|
+
icon="vaccination"
|
|
233
|
+
iconbgcolor="transparent"
|
|
234
|
+
iconcolor="ap-red"
|
|
235
|
+
large="false"
|
|
236
|
+
medium="false"
|
|
237
|
+
size="modified-icon-size"
|
|
238
|
+
small="false"
|
|
239
|
+
uniqueid="modified-unique-id-icon-2"
|
|
240
|
+
widthauto="false"
|
|
241
|
+
xlarge="false"
|
|
242
|
+
></amelipro-icon-stub>
|
|
243
|
+
<span
|
|
244
|
+
class="
|
|
245
|
+
amelipro-illustrated-radio-group__item-label-text
|
|
246
|
+
mt-4
|
|
247
|
+
text-ap-blue-darken-1
|
|
248
|
+
"
|
|
249
|
+
id="modified-unique-id-label-text-2"
|
|
250
|
+
>
|
|
251
|
+
the item label 3
|
|
252
|
+
</span>
|
|
253
|
+
</span>
|
|
254
|
+
</span>
|
|
255
|
+
</label>
|
|
256
|
+
</li>
|
|
257
|
+
</ul>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
<amelipro-message-stub
|
|
261
|
+
alignstart="false"
|
|
262
|
+
borderleftmessage="false"
|
|
263
|
+
dark="false"
|
|
264
|
+
dismissible="false"
|
|
265
|
+
noicon="true"
|
|
266
|
+
text="true"
|
|
267
|
+
type="error"
|
|
268
|
+
uniqueid="modified-unique-id-error"
|
|
269
|
+
value="true"
|
|
270
|
+
width="100%"
|
|
271
|
+
></amelipro-message-stub>
|
|
272
|
+
</div>
|
|
273
|
+
`;
|
|
274
|
+
|
|
275
|
+
exports[`AmeliproIllustratedRadioGroup > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
276
|
+
<div
|
|
277
|
+
class="amelipro-illustrated-radio-group"
|
|
278
|
+
id="required-unique-id-container"
|
|
279
|
+
>
|
|
280
|
+
<div>
|
|
281
|
+
<div
|
|
282
|
+
class="
|
|
283
|
+
align-center
|
|
284
|
+
amelipro-illustrated-radio-group__label-wrapper
|
|
285
|
+
d-flex
|
|
286
|
+
mr-2
|
|
287
|
+
"
|
|
288
|
+
id="required-unique-id-label-group"
|
|
289
|
+
>
|
|
290
|
+
<p
|
|
291
|
+
class="
|
|
292
|
+
amelipro-illustrated-radio-group__label
|
|
293
|
+
d-inline-flex
|
|
294
|
+
mb-0
|
|
295
|
+
"
|
|
296
|
+
id="required-unique-id"
|
|
297
|
+
>
|
|
298
|
+
Required group label
|
|
299
|
+
<!-- v-if -->
|
|
300
|
+
<!-- v-if -->
|
|
301
|
+
</p>
|
|
302
|
+
</div>
|
|
303
|
+
<div
|
|
304
|
+
aria-labelledby="required-unique-id"
|
|
305
|
+
aria-required="false"
|
|
306
|
+
class="
|
|
307
|
+
amelipro-illustrated-radio-group__group
|
|
308
|
+
mt-2
|
|
309
|
+
"
|
|
310
|
+
role="radiogroup"
|
|
311
|
+
>
|
|
312
|
+
<ul
|
|
313
|
+
class="
|
|
314
|
+
amelipro-illustrated-radio-group__list
|
|
315
|
+
d-flex
|
|
316
|
+
flex-wrap
|
|
317
|
+
list-style-none
|
|
318
|
+
"
|
|
319
|
+
id="required-unique-id-list"
|
|
320
|
+
></ul>
|
|
321
|
+
</div>
|
|
322
|
+
</div>
|
|
323
|
+
<!-- v-if -->
|
|
324
|
+
</div>
|
|
325
|
+
`;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { VueWrapper, mount, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
3
|
+
import AmeliproMailTile from '../AmeliproMailTile.vue'
|
|
4
|
+
import type { AmeliproMailTileType } from '../types'
|
|
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 AmeliproMailTile> = {
|
|
11
|
+
editable: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false,
|
|
14
|
+
},
|
|
15
|
+
mailInfo: {
|
|
16
|
+
type: Object as PropType<AmeliproMailTileType>,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
uniqueId: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Values pour les props "required"
|
|
26
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproMailTile> => ({
|
|
27
|
+
mailInfo: {
|
|
28
|
+
commentValue: true,
|
|
29
|
+
date: '25/06/2023',
|
|
30
|
+
hour: '12h00',
|
|
31
|
+
href: '#required',
|
|
32
|
+
mailObject: 'Required mail object',
|
|
33
|
+
messageInfoFirstLine: 'Required info line 1',
|
|
34
|
+
messageInfoSecondLine: 'Required info line 2',
|
|
35
|
+
messageInfoThirdLine: 'Required info line 3',
|
|
36
|
+
readValue: true,
|
|
37
|
+
} as AmeliproMailTileType,
|
|
38
|
+
uniqueId: 'required-unique-id',
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
// Valeurs pour les props "modified"
|
|
42
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproMailTile> => ({
|
|
43
|
+
editable: true,
|
|
44
|
+
mailInfo: {
|
|
45
|
+
commentValue: false,
|
|
46
|
+
date: '26/06/2023',
|
|
47
|
+
hour: '13h00',
|
|
48
|
+
href: '#modified',
|
|
49
|
+
mailObject: 'Modified mail object',
|
|
50
|
+
messageInfoFirstLine: 'Modified info line 1',
|
|
51
|
+
messageInfoSecondLine: 'Modified info line 2',
|
|
52
|
+
messageInfoThirdLine: 'Modified info line 3',
|
|
53
|
+
readValue: false,
|
|
54
|
+
} as AmeliproMailTileType,
|
|
55
|
+
uniqueId: 'modified-unique-id',
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const testHelper = new TestHelper(AmeliproMailTile)
|
|
59
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
60
|
+
.setRequiredPropValues(requiredPropValues)
|
|
61
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
62
|
+
|
|
63
|
+
describe('AmeliproMailTile', () => {
|
|
64
|
+
describe('Snapshots', () => {
|
|
65
|
+
testHelper.snapshots()
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
describe('Properties', () => {
|
|
69
|
+
testHelper.properties()
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
describe('Setting props should update attributes of inner tags', () => {
|
|
73
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproMailTile>>
|
|
74
|
+
|
|
75
|
+
beforeEach(() => {
|
|
76
|
+
vueWrapper = mount(AmeliproMailTile, {
|
|
77
|
+
props: requiredPropValues(),
|
|
78
|
+
global: { stubs: { VBtn: { template: '<button><slot /></button>' } } },
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
83
|
+
expect(vueWrapper.attributes('id')).toBe(`${testHelper.default('uniqueId')}-container`)
|
|
84
|
+
const { uniqueId } = modifiedPropValues()
|
|
85
|
+
await vueWrapper.setProps({ uniqueId })
|
|
86
|
+
expect(vueWrapper.attributes('id')).toBe(`${testHelper.modified('uniqueId')}-container`)
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it('prop mailInfo sets mail object', async () => {
|
|
90
|
+
expect(vueWrapper.find(`#${testHelper.default('uniqueId')}-mail-object`).exists()).toBe(true)
|
|
91
|
+
expect(vueWrapper.find(`#${testHelper.default('uniqueId')}-mail-object`).text()).toContain(testHelper.default('mailInfo').mailObject)
|
|
92
|
+
|
|
93
|
+
const { mailInfo, uniqueId } = modifiedPropValues()
|
|
94
|
+
await vueWrapper.setProps({ mailInfo, uniqueId })
|
|
95
|
+
expect(vueWrapper.find(`#${testHelper.modified('uniqueId')}-mail-object`).exists()).toBe(true)
|
|
96
|
+
expect(vueWrapper.find(`#${testHelper.modified('uniqueId')}-mail-object`).text()).toContain(testHelper.modified('mailInfo').mailObject)
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
it('prop editable sets edit mode', async () => {
|
|
100
|
+
expect(vueWrapper.find('.mail-status-btn').exists()).toBe(false)
|
|
101
|
+
await vueWrapper.setProps({ editable: true })
|
|
102
|
+
expect(vueWrapper.find('.mail-status-btn').exists()).toBe(true)
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
describe('Events', () => {
|
|
107
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproMailTile>>
|
|
108
|
+
|
|
109
|
+
beforeEach(() => {
|
|
110
|
+
vueWrapper = shallowMount(AmeliproMailTile, { props: { ...requiredPropValues(), editable: true } })
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
it('emit status-change when clicking mail-status-btn', async () => {
|
|
114
|
+
expect(vueWrapper.emitted('status-change')).toBeUndefined()
|
|
115
|
+
await vueWrapper.find('.mail-status-btn').trigger('click')
|
|
116
|
+
expect(vueWrapper.emitted('status-change')).toBeTruthy()
|
|
117
|
+
expect(vueWrapper.emitted('status-change')?.[0]).toEqual([testHelper.default('uniqueId')])
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
it('emit click when clicking not-editable tile', async () => {
|
|
121
|
+
await vueWrapper.setProps({ editable: false })
|
|
122
|
+
expect(vueWrapper.emitted('click')).toBeUndefined()
|
|
123
|
+
await vueWrapper.find('.amelipro-mail-tile__not-editable').trigger('click')
|
|
124
|
+
expect(vueWrapper.emitted('click')).toBeTruthy()
|
|
125
|
+
expect(vueWrapper.emitted('click')?.[0]).toEqual([testHelper.default('uniqueId')])
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
describe('Editable info text', () => {
|
|
130
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproMailTile>>
|
|
131
|
+
|
|
132
|
+
beforeEach(() => {
|
|
133
|
+
vueWrapper = shallowMount(AmeliproMailTile, {
|
|
134
|
+
props: { ...requiredPropValues(), editable: true },
|
|
135
|
+
global: { stubs: { VBtn: { template: '<button><slot /></button>' } } },
|
|
136
|
+
})
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
it('prop mailInfo.commentValue sets comment icon visibility', async () => {
|
|
140
|
+
expect(vueWrapper.find('.mail-info__comment-icon').exists()).toBe(true)
|
|
141
|
+
|
|
142
|
+
const { mailInfo } = modifiedPropValues()
|
|
143
|
+
await vueWrapper.setProps({ mailInfo })
|
|
144
|
+
expect(vueWrapper.find('.mail-info__comment-icon').exists()).toBe(false)
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
describe('Mail status button', () => {
|
|
149
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproMailTile>>
|
|
150
|
+
|
|
151
|
+
beforeEach(() => {
|
|
152
|
+
vueWrapper = shallowMount(AmeliproMailTile, {
|
|
153
|
+
props: { ...requiredPropValues(), editable: true },
|
|
154
|
+
// global: { stubs: { VBtn: { template: '<button><slot /></button>' } } },
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
159
|
+
expect(vueWrapper.find('.mail-status-btn').attributes('id')).toBe(`${testHelper.default('uniqueId')}-read-btn`)
|
|
160
|
+
|
|
161
|
+
const { uniqueId } = modifiedPropValues()
|
|
162
|
+
await vueWrapper.setProps({ uniqueId })
|
|
163
|
+
expect(vueWrapper.find('.mail-status-btn').attributes('id')).toBe(`${testHelper.modified('uniqueId')}-read-btn`)
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
it('prop mailInfo.readValue sets attribute aria-label', async () => {
|
|
167
|
+
expect(vueWrapper.find('.mail-status-btn').attributes('aria-label')).toBe('Message lu')
|
|
168
|
+
|
|
169
|
+
const { mailInfo } = modifiedPropValues()
|
|
170
|
+
await vueWrapper.setProps({ mailInfo })
|
|
171
|
+
// TODO: test ne passe pas, la prop ne semble pas réactive
|
|
172
|
+
// expect(vueWrapper.find('.mail-status-btn').attributes('aria-label')).toBe('Message non lu')
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
it('prop mailInfo.readValue sets attribute aria-pressed', async () => {
|
|
176
|
+
expect(vueWrapper.find('.mail-status-btn').attributes('aria-pressed')).toBe('true')
|
|
177
|
+
|
|
178
|
+
const { mailInfo } = modifiedPropValues()
|
|
179
|
+
await vueWrapper.setProps({ mailInfo })
|
|
180
|
+
// TODO: test ne passe pas, la prop ne semble pas réactive
|
|
181
|
+
// expect(vueWrapper.find('.mail-status-btn').attributes('aria-pressed')).toBe('false')
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
it('prop mailInfo.readValue sets class mail-status-btn--not-read', async () => {
|
|
185
|
+
expect(vueWrapper.find('.mail-status-btn').classes('mail-status-btn--not-read')).toBe(false)
|
|
186
|
+
|
|
187
|
+
const { mailInfo } = modifiedPropValues()
|
|
188
|
+
expect(mailInfo.readValue).toBe(false)
|
|
189
|
+
await vueWrapper.setProps({ mailInfo })
|
|
190
|
+
// TODO: test ne passe pas, la prop ne semble pas réactive
|
|
191
|
+
// expect(vueWrapper.find('.mail-status-btn').classes('mail-status-btn--not-read')).toBe(true)
|
|
192
|
+
})
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
describe('backgroundStyle changes on status change', () => {
|
|
196
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproMailTile>>
|
|
197
|
+
|
|
198
|
+
beforeEach(() => {
|
|
199
|
+
vueWrapper = shallowMount(AmeliproMailTile, { props: { ...requiredPropValues(), editable: true } })
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
it('backgroundStyle changes after click', async () => {
|
|
203
|
+
const btn = vueWrapper.find('.mail-status-btn')
|
|
204
|
+
const initialStyle = btn.attributes('style')
|
|
205
|
+
await btn.trigger('click')
|
|
206
|
+
const afterClickStyle = btn.attributes('style')
|
|
207
|
+
expect(initialStyle).not.toBe(afterClickStyle)
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
})
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`AmeliproMailTile > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
class="
|
|
6
|
+
amelipro-mail-tile
|
|
7
|
+
w-100
|
|
8
|
+
"
|
|
9
|
+
id="modified-unique-id-container"
|
|
10
|
+
>
|
|
11
|
+
<div class="
|
|
12
|
+
amelipro-mail-tile__editable
|
|
13
|
+
d-flex
|
|
14
|
+
w-100
|
|
15
|
+
">
|
|
16
|
+
<button
|
|
17
|
+
aria-label="Message lu"
|
|
18
|
+
aria-pressed="false"
|
|
19
|
+
class="
|
|
20
|
+
mail-status-btn
|
|
21
|
+
mail-status-btn--not-read
|
|
22
|
+
"
|
|
23
|
+
id="modified-unique-id-read-btn"
|
|
24
|
+
style="background-color: #E6F6FC;"
|
|
25
|
+
title="Message non lu"
|
|
26
|
+
></button>
|
|
27
|
+
<v-btn-stub
|
|
28
|
+
block="false"
|
|
29
|
+
border="false"
|
|
30
|
+
class="
|
|
31
|
+
d-block
|
|
32
|
+
mail-btn--editable
|
|
33
|
+
text-none
|
|
34
|
+
"
|
|
35
|
+
color="ap-blue-lighten-3"
|
|
36
|
+
density="default"
|
|
37
|
+
disabled="false"
|
|
38
|
+
elevation="0"
|
|
39
|
+
exact="false"
|
|
40
|
+
flat="true"
|
|
41
|
+
href="#modified"
|
|
42
|
+
icon="false"
|
|
43
|
+
id="modified-unique-id-mail-btn"
|
|
44
|
+
loading="false"
|
|
45
|
+
replace="false"
|
|
46
|
+
ripple="false"
|
|
47
|
+
size="default"
|
|
48
|
+
slim="false"
|
|
49
|
+
stacked="false"
|
|
50
|
+
symbol="Symbol(vuetify:v-btn-toggle)"
|
|
51
|
+
tag="button"
|
|
52
|
+
tile="false"
|
|
53
|
+
variant="flat"
|
|
54
|
+
></v-btn-stub>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
exports[`AmeliproMailTile > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
60
|
+
<div
|
|
61
|
+
class="
|
|
62
|
+
amelipro-mail-tile
|
|
63
|
+
w-100
|
|
64
|
+
"
|
|
65
|
+
id="required-unique-id-container"
|
|
66
|
+
>
|
|
67
|
+
<v-btn-stub
|
|
68
|
+
block="false"
|
|
69
|
+
border="false"
|
|
70
|
+
class="
|
|
71
|
+
amelipro-mail-tile__not-editable
|
|
72
|
+
mail-btn
|
|
73
|
+
text-none
|
|
74
|
+
w-100
|
|
75
|
+
"
|
|
76
|
+
color="ap-white"
|
|
77
|
+
density="default"
|
|
78
|
+
disabled="false"
|
|
79
|
+
elevation="0"
|
|
80
|
+
exact="false"
|
|
81
|
+
flat="true"
|
|
82
|
+
href="#required"
|
|
83
|
+
icon="false"
|
|
84
|
+
id="required-unique-id-mail-btn"
|
|
85
|
+
loading="false"
|
|
86
|
+
replace="false"
|
|
87
|
+
ripple="false"
|
|
88
|
+
size="default"
|
|
89
|
+
slim="false"
|
|
90
|
+
stacked="false"
|
|
91
|
+
symbol="Symbol(vuetify:v-btn-toggle)"
|
|
92
|
+
tag="button"
|
|
93
|
+
tile="false"
|
|
94
|
+
title="Message lu"
|
|
95
|
+
variant="flat"
|
|
96
|
+
></v-btn-stub>
|
|
97
|
+
</div>
|
|
98
|
+
`;
|