@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,241 @@
|
|
|
1
|
+
import { VueWrapper, mount, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
3
|
+
import AmeliproTileBtn from '../AmeliproTileBtn.vue'
|
|
4
|
+
import type { ComponentProps } from 'vue-component-type-helpers'
|
|
5
|
+
import type { ExpectedPropOptions } from '@tests/types'
|
|
6
|
+
import type { PropType } from 'vue'
|
|
7
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
8
|
+
import TestHelper from '@tests/helpers/TestHelper'
|
|
9
|
+
|
|
10
|
+
const expectedPropOptions: ExpectedPropOptions<typeof AmeliproTileBtn> = {
|
|
11
|
+
alignTopStyle: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false,
|
|
14
|
+
},
|
|
15
|
+
borderDash: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false,
|
|
18
|
+
},
|
|
19
|
+
complementaryInfoLine1: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: undefined,
|
|
22
|
+
},
|
|
23
|
+
complementaryInfoLine2: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: undefined,
|
|
26
|
+
},
|
|
27
|
+
disabled: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false,
|
|
30
|
+
},
|
|
31
|
+
href: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: undefined,
|
|
34
|
+
},
|
|
35
|
+
imgMaxWidth: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: undefined,
|
|
38
|
+
},
|
|
39
|
+
imgMinWidth: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: undefined,
|
|
42
|
+
},
|
|
43
|
+
imgSrc: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
47
|
+
imgWidth: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '100px',
|
|
50
|
+
},
|
|
51
|
+
invalid: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
55
|
+
label: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
labelBottom: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: undefined,
|
|
62
|
+
},
|
|
63
|
+
message: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: undefined,
|
|
66
|
+
},
|
|
67
|
+
messageType: {
|
|
68
|
+
default: 'info',
|
|
69
|
+
type: String,
|
|
70
|
+
validator(value: string): boolean {
|
|
71
|
+
return ['info', 'error', 'warning'].includes(value.toLowerCase())
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
tileMinHeight: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: undefined,
|
|
77
|
+
},
|
|
78
|
+
tilePadding: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: '2rem 1.5rem',
|
|
81
|
+
},
|
|
82
|
+
tileWidth: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: '100%',
|
|
85
|
+
},
|
|
86
|
+
to: {
|
|
87
|
+
type: [Array, Object, String] as PropType<RouteLocationRaw>,
|
|
88
|
+
default: undefined,
|
|
89
|
+
},
|
|
90
|
+
uniqueId: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: undefined,
|
|
93
|
+
},
|
|
94
|
+
valid: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false,
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Values pour les props "required"
|
|
101
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproTileBtn> => ({
|
|
102
|
+
imgSrc: 'required-img-src',
|
|
103
|
+
label: 'Required label',
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
// Valeurs pour les props "modified"
|
|
107
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproTileBtn> => ({
|
|
108
|
+
alignTopStyle: true,
|
|
109
|
+
borderDash: true,
|
|
110
|
+
complementaryInfoLine1: 'Modified complementary info line 1',
|
|
111
|
+
complementaryInfoLine2: 'Modified complementary info line 2',
|
|
112
|
+
disabled: true,
|
|
113
|
+
href: 'modified-href',
|
|
114
|
+
imgMaxWidth: 'modified-img-max-width',
|
|
115
|
+
imgMinWidth: 'modified-img-min-width',
|
|
116
|
+
imgSrc: 'modified-img-src',
|
|
117
|
+
imgWidth: 'modified-img-width',
|
|
118
|
+
invalid: true,
|
|
119
|
+
label: 'Modified label',
|
|
120
|
+
labelBottom: 'Modified label bottom',
|
|
121
|
+
message: 'Modified message',
|
|
122
|
+
messageType: 'warning',
|
|
123
|
+
tileMinHeight: 'modified-tile-min-height',
|
|
124
|
+
tilePadding: 'modified-tile-padding',
|
|
125
|
+
tileWidth: 'modified-tile-width',
|
|
126
|
+
to: 'modified-to',
|
|
127
|
+
uniqueId: 'modified-unique-id',
|
|
128
|
+
valid: true,
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
const testHelper = new TestHelper(AmeliproTileBtn)
|
|
132
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
133
|
+
.setRequiredPropValues(requiredPropValues)
|
|
134
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
135
|
+
|
|
136
|
+
describe('AmeliproTileBtn', () => {
|
|
137
|
+
describe('Snapshots', () => {
|
|
138
|
+
testHelper.snapshots()
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
describe('Properties', () => {
|
|
142
|
+
testHelper.properties()
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
describe.skip('Setting props should update attributes of inner tags', () => {
|
|
146
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproTileBtn>>
|
|
147
|
+
|
|
148
|
+
beforeEach(() => {
|
|
149
|
+
vueWrapper = shallowMount(AmeliproTileBtn, { props: requiredPropValues() })
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
it('prop borderDash sets button style', async () => {
|
|
153
|
+
expect(vueWrapper.attributes().style).toBe('background-color: rgb(255, 255, 255); color: rgb(26, 27, 27); padding: 2rem 1.5rem; border: 2px solid #ffffff !important;')
|
|
154
|
+
await vueWrapper.setProps({ borderDash: testHelper.modified('borderDash') })
|
|
155
|
+
expect(vueWrapper.attributes().style).toBe('background-color: rgb(255, 255, 255); color: rgb(26, 27, 27); padding: 2rem 1.5rem; border: 2px dashed #99dbf2;')
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
it('props imgMaxWidth, imgMinWidth, imgWidth set img style', async () => {
|
|
159
|
+
const element = vueWrapper.find('img')
|
|
160
|
+
expect(element.exists()).toBe(true)
|
|
161
|
+
expect(element.attributes().style).toBe('width: 100px;')
|
|
162
|
+
await vueWrapper.setProps({
|
|
163
|
+
imgMaxWidth: testHelper.modified('imgMaxWidth'),
|
|
164
|
+
imgMinWidth: testHelper.modified('imgMinWidth'),
|
|
165
|
+
imgWidth: testHelper.modified('imgWidth'),
|
|
166
|
+
})
|
|
167
|
+
expect(element.attributes().style).toBe('width: 100px;')
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
describe('Setting props should update props or attributes of inner components', () => {
|
|
172
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproTileBtn>>
|
|
173
|
+
|
|
174
|
+
beforeEach(() => {
|
|
175
|
+
vueWrapper = shallowMount(AmeliproTileBtn, { props: requiredPropValues() })
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
it('prop label sets label text', async () => {
|
|
179
|
+
expect(vueWrapper.props('label')).toBe(testHelper.default('label'))
|
|
180
|
+
await vueWrapper.setProps({ label: testHelper.modified('label') })
|
|
181
|
+
expect(vueWrapper.props('label')).toBe(testHelper.modified('label'))
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
it('prop labelBottom sets labelBottom prop', async () => {
|
|
185
|
+
expect(vueWrapper.props('labelBottom')).toBe(testHelper.default('labelBottom'))
|
|
186
|
+
await vueWrapper.setProps({ labelBottom: testHelper.modified('labelBottom') })
|
|
187
|
+
expect(vueWrapper.props('labelBottom')).toBe(testHelper.modified('labelBottom'))
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
it('prop complementaryInfoLine1 sets complementaryInfoLine1 prop', async () => {
|
|
191
|
+
expect(vueWrapper.props('complementaryInfoLine1')).toBe(testHelper.default('complementaryInfoLine1'))
|
|
192
|
+
await vueWrapper.setProps({ complementaryInfoLine1: testHelper.modified('complementaryInfoLine1') })
|
|
193
|
+
expect(vueWrapper.props('complementaryInfoLine1')).toBe(testHelper.modified('complementaryInfoLine1'))
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
it('prop complementaryInfoLine2 sets complementaryInfoLine2 prop', async () => {
|
|
197
|
+
expect(vueWrapper.props('complementaryInfoLine2')).toBe(testHelper.default('complementaryInfoLine2'))
|
|
198
|
+
await vueWrapper.setProps({ complementaryInfoLine2: testHelper.modified('complementaryInfoLine2') })
|
|
199
|
+
expect(vueWrapper.props('complementaryInfoLine2')).toBe(testHelper.modified('complementaryInfoLine2'))
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
it('prop disabled sets disabled prop', async () => {
|
|
203
|
+
expect(vueWrapper.props('disabled')).toBe(testHelper.default('disabled'))
|
|
204
|
+
await vueWrapper.setProps({ disabled: testHelper.modified('disabled') })
|
|
205
|
+
expect(vueWrapper.props('disabled')).toBe(testHelper.modified('disabled'))
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
it('prop href sets href prop', async () => {
|
|
209
|
+
expect(vueWrapper.props('href')).toBe(testHelper.default('href'))
|
|
210
|
+
await vueWrapper.setProps({ href: testHelper.modified('href') })
|
|
211
|
+
expect(vueWrapper.props('href')).toBe(testHelper.modified('href'))
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
it('prop to sets to prop', async () => {
|
|
215
|
+
expect(vueWrapper.props('to')).toBe(testHelper.default('to'))
|
|
216
|
+
await vueWrapper.setProps({ to: testHelper.modified('to') })
|
|
217
|
+
expect(vueWrapper.props('to')).toBe(testHelper.modified('to'))
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
it('prop uniqueId sets uniqueId prop', async () => {
|
|
221
|
+
expect(vueWrapper.props('uniqueId')).toBe(testHelper.default('uniqueId'))
|
|
222
|
+
await vueWrapper.setProps({ uniqueId: testHelper.modified('uniqueId') })
|
|
223
|
+
expect(vueWrapper.props('uniqueId')).toBe(testHelper.modified('uniqueId'))
|
|
224
|
+
})
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
describe('Events', () => {
|
|
228
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproTileBtn>>
|
|
229
|
+
|
|
230
|
+
beforeEach(() => {
|
|
231
|
+
vueWrapper = mount(AmeliproTileBtn, { props: modifiedPropValues() })
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
it('emits a click event when button is clicked', async () => {
|
|
235
|
+
expect(vueWrapper.exists()).toBe(true)
|
|
236
|
+
expect(vueWrapper.emitted('click')).toBeUndefined()
|
|
237
|
+
await vueWrapper.trigger('click')
|
|
238
|
+
expect(vueWrapper.emitted('click')).toStrictEqual([['modified-unique-id']])
|
|
239
|
+
})
|
|
240
|
+
})
|
|
241
|
+
})
|
package/src/components/Amelipro/AmeliproTileBtn/__tests__/__snapshots__/AmeliproTileBtn.spec.ts.snap
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`AmeliproTileBtn > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
|
+
<v-btn-stub
|
|
5
|
+
block="false"
|
|
6
|
+
border="false"
|
|
7
|
+
class="
|
|
8
|
+
amelipro-tile-btn
|
|
9
|
+
text-none
|
|
10
|
+
"
|
|
11
|
+
density="default"
|
|
12
|
+
disabled="true"
|
|
13
|
+
elevation="1"
|
|
14
|
+
exact="false"
|
|
15
|
+
flat="false"
|
|
16
|
+
height="auto"
|
|
17
|
+
href="modified-href"
|
|
18
|
+
icon="false"
|
|
19
|
+
id="modified-unique-id"
|
|
20
|
+
loading="false"
|
|
21
|
+
minheight="modified-tile-min-height"
|
|
22
|
+
replace="false"
|
|
23
|
+
ripple="false"
|
|
24
|
+
size="default"
|
|
25
|
+
slim="false"
|
|
26
|
+
stacked="false"
|
|
27
|
+
style="
|
|
28
|
+
background-color: #DDDEDE !important;
|
|
29
|
+
border: 2px solid #DDDEDE !important;
|
|
30
|
+
color: #1A1B1B !important;
|
|
31
|
+
"
|
|
32
|
+
symbol="Symbol(vuetify:v-btn-toggle)"
|
|
33
|
+
tag="button"
|
|
34
|
+
tile="false"
|
|
35
|
+
to="modified-to"
|
|
36
|
+
variant="elevated"
|
|
37
|
+
width="modified-tile-width"
|
|
38
|
+
></v-btn-stub>
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
exports[`AmeliproTileBtn > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
42
|
+
<v-btn-stub
|
|
43
|
+
block="false"
|
|
44
|
+
border="false"
|
|
45
|
+
class="
|
|
46
|
+
amelipro-tile-btn
|
|
47
|
+
text-none
|
|
48
|
+
"
|
|
49
|
+
density="default"
|
|
50
|
+
disabled="false"
|
|
51
|
+
elevation="1"
|
|
52
|
+
exact="false"
|
|
53
|
+
flat="false"
|
|
54
|
+
height="auto"
|
|
55
|
+
icon="false"
|
|
56
|
+
loading="false"
|
|
57
|
+
replace="false"
|
|
58
|
+
ripple="false"
|
|
59
|
+
size="default"
|
|
60
|
+
slim="false"
|
|
61
|
+
stacked="false"
|
|
62
|
+
style="
|
|
63
|
+
background-color: #FFFFFF;
|
|
64
|
+
border: 2px solid #FFFFFF !important;
|
|
65
|
+
color: #1A1B1B;
|
|
66
|
+
padding: 2rem 1.5rem;
|
|
67
|
+
"
|
|
68
|
+
symbol="Symbol(vuetify:v-btn-toggle)"
|
|
69
|
+
tag="button"
|
|
70
|
+
tile="false"
|
|
71
|
+
variant="elevated"
|
|
72
|
+
width="100%"
|
|
73
|
+
></v-btn-stub>
|
|
74
|
+
`;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { VueWrapper, mount, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
3
|
+
import AmeliproTooltips from '../AmeliproTooltips.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 AmeliproTooltips> = {
|
|
9
|
+
btnLabel: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: 'plus d’informations',
|
|
12
|
+
},
|
|
13
|
+
classes: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: undefined,
|
|
16
|
+
},
|
|
17
|
+
iconBgColor: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'ap-white',
|
|
20
|
+
},
|
|
21
|
+
iconColor: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: 'ap-parme-darken-1',
|
|
24
|
+
},
|
|
25
|
+
iconHoverBgColor: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'ap-parme-darken-1',
|
|
28
|
+
},
|
|
29
|
+
iconHoverColor: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'ap-white',
|
|
32
|
+
},
|
|
33
|
+
iconName: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'aide',
|
|
36
|
+
},
|
|
37
|
+
tooltipBg: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'ap-white',
|
|
40
|
+
},
|
|
41
|
+
tooltipText: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'Test',
|
|
44
|
+
},
|
|
45
|
+
tooltipTextColor: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: 'ap-grey-darken-1',
|
|
48
|
+
},
|
|
49
|
+
uniqueId: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: true,
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Values pour les props "required"
|
|
56
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproTooltips> => ({ uniqueId: 'required-unique-id' })
|
|
57
|
+
|
|
58
|
+
// Valeurs pour les props "modified"
|
|
59
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproTooltips> => ({
|
|
60
|
+
btnLabel: 'Modified btn label',
|
|
61
|
+
iconBgColor: 'ap-green',
|
|
62
|
+
iconColor: 'ap-green-darken-1',
|
|
63
|
+
iconHoverBgColor: 'ap-red',
|
|
64
|
+
iconHoverColor: 'ap-red-darken-1',
|
|
65
|
+
iconName: 'home',
|
|
66
|
+
tooltipBg: 'ap-blue',
|
|
67
|
+
tooltipText: 'Modified tooltip text',
|
|
68
|
+
tooltipTextColor: 'ap-blue-darken-1',
|
|
69
|
+
uniqueId: 'modified-unique-id',
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
const testHelper = new TestHelper(AmeliproTooltips)
|
|
73
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
74
|
+
.setRequiredPropValues(requiredPropValues)
|
|
75
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
76
|
+
|
|
77
|
+
describe('AmeliproTooltips', () => {
|
|
78
|
+
describe('Snapshots', () => {
|
|
79
|
+
testHelper.snapshots()
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
describe('Properties', () => {
|
|
83
|
+
testHelper.properties()
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
describe('Setting props should update attributes of inner tags', () => {
|
|
87
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproTooltips>>
|
|
88
|
+
|
|
89
|
+
describe('root', () => {
|
|
90
|
+
beforeEach(() => {
|
|
91
|
+
vueWrapper = shallowMount(AmeliproTooltips, { props: requiredPropValues() })
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
it('prop uniqueId sets id attribute on root and tooltip', async () => {
|
|
95
|
+
expect(vueWrapper.attributes('id')).toBe(`${testHelper.default('uniqueId')}-container`)
|
|
96
|
+
await vueWrapper.setProps({ uniqueId: testHelper.modified('uniqueId') })
|
|
97
|
+
expect(vueWrapper.attributes('id')).toBe(`${testHelper.modified('uniqueId')}-container`)
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
// Le contenu des #slot n'est pas visible avec shallowMount
|
|
102
|
+
describe('tooltip text', () => {
|
|
103
|
+
const tooltipContentFinder = () => document.querySelector('.amelipro-tooltip__text')
|
|
104
|
+
|
|
105
|
+
beforeEach(() => {
|
|
106
|
+
// On ne devrait théoriquement pas avoir besoin de ça, mais dans les faits...
|
|
107
|
+
document.body.innerHTML = ''
|
|
108
|
+
|
|
109
|
+
// console.log({ nb: document.querySelectorAll('.amelipro-tooltip__text').length });
|
|
110
|
+
|
|
111
|
+
vueWrapper = mount(AmeliproTooltips, { props: requiredPropValues() })
|
|
112
|
+
|
|
113
|
+
// Visiblement, VTooltip créé un tooltip dans le body dès qu'il est monté
|
|
114
|
+
// console.log({ nb: document.querySelectorAll('.amelipro-tooltip__text').length });
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
afterEach(() => {
|
|
118
|
+
if (vueWrapper) {
|
|
119
|
+
vueWrapper.unmount()
|
|
120
|
+
}
|
|
121
|
+
// Nettoyer tous les tooltips restants dans le body
|
|
122
|
+
document.querySelectorAll('.amelipro-tooltip__text').forEach(el => el.remove())
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
it('prop tooltipText sets tooltip text', async () => {
|
|
126
|
+
// find activator button to trigger tooltip
|
|
127
|
+
const activatorBtn = vueWrapper.find(`#${testHelper.default('uniqueId')}-btn`)
|
|
128
|
+
expect(activatorBtn.exists()).toBe(true)
|
|
129
|
+
|
|
130
|
+
// Trigger tooltip by clicking activator button
|
|
131
|
+
await activatorBtn.trigger('touchstart')
|
|
132
|
+
|
|
133
|
+
// Chercher dans le document global (et non dans le wrapper)
|
|
134
|
+
expect(tooltipContentFinder()).not.toBeNull()
|
|
135
|
+
expect(vueWrapper.find('.amelipro-tooltip__text').exists()).toBe(false)
|
|
136
|
+
expect(tooltipContentFinder()?.textContent).toBe(testHelper.default('tooltipText'))
|
|
137
|
+
await vueWrapper.setProps({ tooltipText: testHelper.modified('tooltipText') })
|
|
138
|
+
expect(tooltipContentFinder()?.textContent).toBe(testHelper.modified('tooltipText'))
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
describe('Setting props should update props or attributes of inner components', () => {
|
|
144
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproTooltips>>
|
|
145
|
+
|
|
146
|
+
beforeEach(() => {
|
|
147
|
+
// On utilise mount car AmeliproIconBtn est contenu dans un slot
|
|
148
|
+
// et shallowMount ne rend pas les slots.
|
|
149
|
+
vueWrapper = mount(AmeliproTooltips, { props: requiredPropValues() })
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
it('prop btnLabel sets btn-label prop of AmeliproIconBtn', async () => {
|
|
153
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('btnLabel')).toBe(testHelper.default('btnLabel'))
|
|
154
|
+
await vueWrapper.setProps({ btnLabel: testHelper.modified('btnLabel') })
|
|
155
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('btnLabel')).toBe(testHelper.modified('btnLabel'))
|
|
156
|
+
})
|
|
157
|
+
it('prop iconName sets icon prop of AmeliproIconBtn', async () => {
|
|
158
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('icon')).toBe(testHelper.default('iconName'))
|
|
159
|
+
await vueWrapper.setProps({ iconName: testHelper.modified('iconName') })
|
|
160
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('icon')).toBe(testHelper.modified('iconName'))
|
|
161
|
+
})
|
|
162
|
+
it('prop iconBgColor sets icon-bg-color prop of AmeliproIconBtn', async () => {
|
|
163
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('iconBgColor')).toBe(testHelper.default('iconBgColor'))
|
|
164
|
+
await vueWrapper.setProps({ iconBgColor: testHelper.modified('iconBgColor') })
|
|
165
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('iconBgColor')).toBe(testHelper.modified('iconBgColor'))
|
|
166
|
+
})
|
|
167
|
+
it('prop iconColor sets icon-color prop of AmeliproIconBtn', async () => {
|
|
168
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('iconColor')).toBe(testHelper.default('iconColor'))
|
|
169
|
+
await vueWrapper.setProps({ iconColor: testHelper.modified('iconColor') })
|
|
170
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('iconColor')).toBe(testHelper.modified('iconColor'))
|
|
171
|
+
})
|
|
172
|
+
it('prop iconHoverBgColor sets icon-hover-bg-color prop of AmeliproIconBtn', async () => {
|
|
173
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('iconHoverBgColor')).toBe(testHelper.default('iconHoverBgColor'))
|
|
174
|
+
await vueWrapper.setProps({ iconHoverBgColor: testHelper.modified('iconHoverBgColor') })
|
|
175
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('iconHoverBgColor')).toBe(testHelper.modified('iconHoverBgColor'))
|
|
176
|
+
})
|
|
177
|
+
it('prop iconHoverColor sets icon-hover-color prop of AmeliproIconBtn', async () => {
|
|
178
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('iconHoverColor')).toBe(testHelper.default('iconHoverColor'))
|
|
179
|
+
await vueWrapper.setProps({ iconHoverColor: testHelper.modified('iconHoverColor') })
|
|
180
|
+
expect(vueWrapper.findComponent({ name: 'AmeliproIconBtn' }).props('iconHoverColor')).toBe(testHelper.modified('iconHoverColor'))
|
|
181
|
+
})
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
describe('Events', () => {
|
|
185
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproTooltips>>
|
|
186
|
+
|
|
187
|
+
beforeEach(() => {
|
|
188
|
+
vueWrapper = shallowMount(AmeliproTooltips, { props: requiredPropValues() })
|
|
189
|
+
})
|
|
190
|
+
it('should not emit any event by default', () => {
|
|
191
|
+
expect(vueWrapper.emitted()).toEqual({})
|
|
192
|
+
})
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
describe('Slots', () => {
|
|
196
|
+
// le contenu du slot par défaut (celui du tooltip) n’est rendu que si show est à true.
|
|
197
|
+
it('renders default slot content', () => {
|
|
198
|
+
mount(AmeliproTooltips, {
|
|
199
|
+
props: requiredPropValues(),
|
|
200
|
+
slots: { default: '<span id="slot-content">Slot Content</span>' },
|
|
201
|
+
})
|
|
202
|
+
expect(document.querySelector('#slot-content')?.textContent).toContain('Slot Content')
|
|
203
|
+
})
|
|
204
|
+
it('renders tooltipActivator slot content', () => {
|
|
205
|
+
const vueWrapper = mount(AmeliproTooltips, {
|
|
206
|
+
props: requiredPropValues(),
|
|
207
|
+
slots: { tooltipActivator: '<button id="activator-btn">Activator</button>' },
|
|
208
|
+
})
|
|
209
|
+
expect(vueWrapper.find('#activator-btn').exists()).toBe(true)
|
|
210
|
+
})
|
|
211
|
+
})
|
|
212
|
+
})
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`AmeliproTooltips > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
class="amelipro-tooltip"
|
|
6
|
+
id="modified-unique-id-container"
|
|
7
|
+
>
|
|
8
|
+
<v-tooltip-stub
|
|
9
|
+
activatorprops="[object Object]"
|
|
10
|
+
attach="false"
|
|
11
|
+
closeonback="false"
|
|
12
|
+
closeoncontentclick="false"
|
|
13
|
+
contained="false"
|
|
14
|
+
contentclass="tooltip-modified-unique-id-js bg-ap-blue"
|
|
15
|
+
disabled="false"
|
|
16
|
+
eager="true"
|
|
17
|
+
id="modified-unique-id"
|
|
18
|
+
interactive="false"
|
|
19
|
+
location="end"
|
|
20
|
+
locationstrategy="connected"
|
|
21
|
+
maxwidth="300px"
|
|
22
|
+
minwidth="0"
|
|
23
|
+
modelvalue="false"
|
|
24
|
+
noclickanimation="false"
|
|
25
|
+
offset="10"
|
|
26
|
+
openonclick="false"
|
|
27
|
+
openonhover="true"
|
|
28
|
+
origin="auto"
|
|
29
|
+
right=""
|
|
30
|
+
scrim="false"
|
|
31
|
+
scrollstrategy="reposition"
|
|
32
|
+
sticktotarget="false"
|
|
33
|
+
zindex="2000"
|
|
34
|
+
></v-tooltip-stub>
|
|
35
|
+
</div>
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
exports[`AmeliproTooltips > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
39
|
+
<div
|
|
40
|
+
class="amelipro-tooltip"
|
|
41
|
+
id="required-unique-id-container"
|
|
42
|
+
>
|
|
43
|
+
<v-tooltip-stub
|
|
44
|
+
activatorprops="[object Object]"
|
|
45
|
+
attach="false"
|
|
46
|
+
closeonback="false"
|
|
47
|
+
closeoncontentclick="false"
|
|
48
|
+
contained="false"
|
|
49
|
+
contentclass="tooltip-required-unique-id-js bg-ap-white"
|
|
50
|
+
disabled="false"
|
|
51
|
+
eager="true"
|
|
52
|
+
id="required-unique-id"
|
|
53
|
+
interactive="false"
|
|
54
|
+
location="end"
|
|
55
|
+
locationstrategy="connected"
|
|
56
|
+
maxwidth="300px"
|
|
57
|
+
minwidth="0"
|
|
58
|
+
modelvalue="false"
|
|
59
|
+
noclickanimation="false"
|
|
60
|
+
offset="10"
|
|
61
|
+
openonclick="false"
|
|
62
|
+
openonhover="true"
|
|
63
|
+
origin="auto"
|
|
64
|
+
right=""
|
|
65
|
+
scrim="false"
|
|
66
|
+
scrollstrategy="reposition"
|
|
67
|
+
sticktotarget="false"
|
|
68
|
+
zindex="2000"
|
|
69
|
+
></v-tooltip-stub>
|
|
70
|
+
</div>
|
|
71
|
+
`;
|