@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
|
@@ -80,7 +80,10 @@ exports[`AmeliproFirstLogin > render correctly 1`] = `
|
|
|
80
80
|
data-no-activator=""
|
|
81
81
|
>
|
|
82
82
|
<span
|
|
83
|
-
class="
|
|
83
|
+
class="
|
|
84
|
+
amelipro-btn__label
|
|
85
|
+
d-sr-only
|
|
86
|
+
"
|
|
84
87
|
id="modified-unique-id-first-login-dialog-close-btn-btn-label"
|
|
85
88
|
>
|
|
86
89
|
Fermer la fenêtre modale
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type PropType,
|
|
2
|
+
import { computed, type PropType, ref, useSlots } from 'vue'
|
|
3
3
|
import AmeliproBtn from '../AmeliproBtn/AmeliproBtn.vue'
|
|
4
4
|
import AmeliproHeaderBar from './AmeliproHeaderBar/AmeliproHeaderBar.vue'
|
|
5
5
|
import type { AmeliproHeaderInfos } from './types'
|
|
@@ -489,7 +489,6 @@
|
|
|
489
489
|
:deep(.v-btn) {
|
|
490
490
|
&.text-service-title {
|
|
491
491
|
display: block;
|
|
492
|
-
white-space: unset;
|
|
493
492
|
}
|
|
494
493
|
}
|
|
495
494
|
</style>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { VueWrapper, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { describe, expect, it } from 'vitest'
|
|
3
|
+
import AmeliproLogoAm from '../AmeliproLogoAm.vue'
|
|
4
|
+
import type { ComponentProps } from 'vue-component-type-helpers'
|
|
5
|
+
import type { ExpectedPropOptions } from '@tests/types'
|
|
6
|
+
import { LogoSizeEnum } from '../LogoSizeEnum'
|
|
7
|
+
import TestHelper from '@tests/helpers/TestHelper'
|
|
8
|
+
|
|
9
|
+
const expectedPropOptions: ExpectedPropOptions<typeof AmeliproLogoAm> = {
|
|
10
|
+
hideSignature: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false,
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
default: LogoSizeEnum.NORMAL,
|
|
16
|
+
type: String,
|
|
17
|
+
validator(value: string): boolean {
|
|
18
|
+
return ['x-small', 'small', 'normal'].includes(value.toLowerCase())
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
uniqueId: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: undefined,
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproLogoAm> => ({})
|
|
28
|
+
|
|
29
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproLogoAm> => ({
|
|
30
|
+
hideSignature: true,
|
|
31
|
+
size: LogoSizeEnum.SMALL,
|
|
32
|
+
uniqueId: 'modified-unique-id',
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const testHelper = new TestHelper(AmeliproLogoAm)
|
|
36
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
37
|
+
.setRequiredPropValues(requiredPropValues)
|
|
38
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
39
|
+
|
|
40
|
+
describe('AmeliproLogoAm', () => {
|
|
41
|
+
describe('Snapshots', () => {
|
|
42
|
+
testHelper.snapshots()
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
describe('Properties', () => {
|
|
46
|
+
testHelper.properties()
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
describe('Setting props should update attributes of inner tags', () => {
|
|
50
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproLogoAm>>
|
|
51
|
+
|
|
52
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
53
|
+
vueWrapper = shallowMount(AmeliproLogoAm, { props: {} })
|
|
54
|
+
expect(vueWrapper.attributes('id')).toBeUndefined()
|
|
55
|
+
|
|
56
|
+
const { uniqueId } = modifiedPropValues()
|
|
57
|
+
await vueWrapper.setProps({ uniqueId })
|
|
58
|
+
expect(vueWrapper.attributes('id')).toBe(testHelper.modified('uniqueId'))
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
it('prop hideSignature sets aria-label', async () => {
|
|
62
|
+
vueWrapper = shallowMount(AmeliproLogoAm, { props: {} })
|
|
63
|
+
const defaultLabel = vueWrapper.attributes('aria-label')
|
|
64
|
+
await vueWrapper.setProps({ hideSignature: true })
|
|
65
|
+
expect(vueWrapper.attributes('aria-label')).not.toBe(defaultLabel)
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('prop size sets width/height', async () => {
|
|
69
|
+
vueWrapper = shallowMount(AmeliproLogoAm, { props: {} })
|
|
70
|
+
const defaultWidth = vueWrapper.attributes('width')
|
|
71
|
+
const defaultHeight = vueWrapper.attributes('height')
|
|
72
|
+
const { size } = modifiedPropValues()
|
|
73
|
+
await vueWrapper.setProps({ size })
|
|
74
|
+
expect(vueWrapper.attributes('width')).not.toBe(defaultWidth)
|
|
75
|
+
expect(vueWrapper.attributes('height')).not.toBe(defaultHeight)
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
})
|
|
@@ -1,13 +1,75 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`AmeliproLogoAm >
|
|
3
|
+
exports[`AmeliproLogoAm > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
|
+
<svg
|
|
5
|
+
aria-label="Sécurité sociale, L’Assurance Maladie"
|
|
6
|
+
class="logo-am"
|
|
7
|
+
fill="#0C419A"
|
|
8
|
+
focusable="false"
|
|
9
|
+
height="52"
|
|
10
|
+
id="modified-unique-id"
|
|
11
|
+
role="img"
|
|
12
|
+
viewBox="0 0 211 64"
|
|
13
|
+
width="164"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
>
|
|
16
|
+
<!-- v-if -->
|
|
17
|
+
<g>
|
|
18
|
+
<path d="m3.3 32.3-.4-.4c.1-.3.3-.5.3-.8 0-.3 0-.4-.2-.4s-.3.1-.4.4l-.2.4c-.1.3-.4.6-.8.6-.5 0-.9-.5-.8-1.1 0-.4.1-.7.4-1l.4.4a1 1 0 0 0-.3.6c0 .2.1.4.3.4.2 0 .2-.2.4-.4l.1-.4c.2-.3.5-.6.9-.5.5 0 .9.5.8 1.2 0 .2-.2.7-.5 1Z" />
|
|
19
|
+
<path d="M.5 28 0 27l.5-.2.4.9-.4.2Zm.4.6.3-1.8h.5L1.6 28h.6l.1-1 .6.1-.1 1 .6.2.2-1.3.6.1-.3 2-3-.5Z" />
|
|
20
|
+
<path d="M2.8 26c-1-.3-1.4-1-1.2-1.8l.6-.8.3.5c-.1.1-.3.2-.3.5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0 0 0 36.5 10c-.2 0-.4-.3-.3-.5 0-.3.2-.4.5-.4a23 23 0 0 1 14 7.5v.7h-.4Z" />
|
|
63
|
+
</svg>
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
exports[`AmeliproLogoAm > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
4
67
|
<svg
|
|
5
68
|
aria-label="Sécurité sociale, L’Assurance Maladie : Agir ensemble, protéger chacun"
|
|
6
69
|
class="logo-am"
|
|
7
70
|
fill="#0C419A"
|
|
8
71
|
focusable="false"
|
|
9
72
|
height="64"
|
|
10
|
-
id="amelipro-logo-id"
|
|
11
73
|
role="img"
|
|
12
74
|
viewBox="0 0 211 64"
|
|
13
75
|
width="211"
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { VueWrapper, mount, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
3
|
+
import AmeliproIcon from '../AmeliproIcon.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
|
+
import { VIcon } from 'vuetify/components'
|
|
8
|
+
import { attachToApp } from '@tests/helpers/utils'
|
|
9
|
+
|
|
10
|
+
const expectedPropOptions: ExpectedPropOptions<typeof AmeliproIcon> = {
|
|
11
|
+
borderColor: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: undefined,
|
|
14
|
+
},
|
|
15
|
+
bordered: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false,
|
|
18
|
+
},
|
|
19
|
+
icon: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: undefined,
|
|
22
|
+
},
|
|
23
|
+
iconBgColor: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: 'transparent',
|
|
26
|
+
},
|
|
27
|
+
iconColor: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
label: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: undefined,
|
|
34
|
+
},
|
|
35
|
+
large: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false,
|
|
38
|
+
},
|
|
39
|
+
mdiPadding: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: undefined,
|
|
42
|
+
},
|
|
43
|
+
medium: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false,
|
|
46
|
+
},
|
|
47
|
+
size: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: undefined,
|
|
50
|
+
},
|
|
51
|
+
small: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
55
|
+
uniqueId: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: undefined,
|
|
58
|
+
},
|
|
59
|
+
widthAuto: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
63
|
+
xLarge: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false,
|
|
66
|
+
},
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Values pour les props "required"
|
|
70
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproIcon> => ({ iconColor: 'ap-black' })
|
|
71
|
+
|
|
72
|
+
// Valeurs pour les props "modified"
|
|
73
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproIcon> => ({
|
|
74
|
+
borderColor: 'ap-blue',
|
|
75
|
+
bordered: true,
|
|
76
|
+
icon: 'utilisateur',
|
|
77
|
+
iconBgColor: 'ap-yellow',
|
|
78
|
+
iconColor: 'ap-green',
|
|
79
|
+
label: 'Modified label',
|
|
80
|
+
large: true,
|
|
81
|
+
mdiPadding: '3em',
|
|
82
|
+
medium: true,
|
|
83
|
+
size: '4rem',
|
|
84
|
+
small: true,
|
|
85
|
+
uniqueId: 'modified-unique-id',
|
|
86
|
+
widthAuto: true,
|
|
87
|
+
xLarge: true,
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
const testHelper = new TestHelper(AmeliproIcon)
|
|
91
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
92
|
+
.setRequiredPropValues(requiredPropValues)
|
|
93
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
94
|
+
|
|
95
|
+
describe('AmeliproIcon', () => {
|
|
96
|
+
describe('Snapshots', () => {
|
|
97
|
+
testHelper.snapshots()
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
describe('Properties', () => {
|
|
101
|
+
testHelper.properties()
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
describe('Setting props should update attributes of inner tags', () => {
|
|
105
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproIcon>>
|
|
106
|
+
|
|
107
|
+
describe('root', () => {
|
|
108
|
+
beforeEach(() => {
|
|
109
|
+
vueWrapper = shallowMount(AmeliproIcon, { props: requiredPropValues() })
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
113
|
+
expect(vueWrapper.find('.amelipro-icon').attributes('id')).toBeUndefined()
|
|
114
|
+
|
|
115
|
+
const { uniqueId } = modifiedPropValues()
|
|
116
|
+
await vueWrapper.setProps({ uniqueId })
|
|
117
|
+
expect(vueWrapper.find('.amelipro-icon').attributes('id')).toBe('modified-unique-id')
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
describe('span.amelipro-custom-icon - without slot', () => {
|
|
122
|
+
const findInnerWrapper = () => vueWrapper.find('.amelipro-custom-icon')
|
|
123
|
+
|
|
124
|
+
beforeEach(() => {
|
|
125
|
+
vueWrapper = shallowMount(AmeliproIcon, { props: requiredPropValues() })
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
it('prop label sets attribute aria-label', async () => {
|
|
129
|
+
expect(findInnerWrapper().attributes('aria-label')).toBeUndefined()
|
|
130
|
+
|
|
131
|
+
const { label } = modifiedPropValues()
|
|
132
|
+
await vueWrapper.setProps({ label })
|
|
133
|
+
expect(findInnerWrapper().attributes('aria-label')).toBe('Modified label')
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
it('prop small sets attribute class', async () => {
|
|
137
|
+
expect(findInnerWrapper().classes('small')).toBe(false)
|
|
138
|
+
|
|
139
|
+
const { small } = modifiedPropValues()
|
|
140
|
+
await vueWrapper.setProps({ small })
|
|
141
|
+
expect(findInnerWrapper().classes('small')).toBe(true)
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
it('prop medium sets attribute class', async () => {
|
|
145
|
+
expect(findInnerWrapper().classes('medium')).toBe(false)
|
|
146
|
+
|
|
147
|
+
const { medium } = modifiedPropValues()
|
|
148
|
+
await vueWrapper.setProps({ medium })
|
|
149
|
+
expect(findInnerWrapper().classes('medium')).toBe(true)
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
it('prop large sets attribute class', async () => {
|
|
153
|
+
expect(findInnerWrapper().classes('large')).toBe(false)
|
|
154
|
+
|
|
155
|
+
const { large } = modifiedPropValues()
|
|
156
|
+
await vueWrapper.setProps({ large })
|
|
157
|
+
expect(findInnerWrapper().classes('large')).toBe(true)
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
it('prop xLarge sets attribute class', async () => {
|
|
161
|
+
expect(findInnerWrapper().classes('x-large')).toBe(false)
|
|
162
|
+
|
|
163
|
+
const { xLarge } = modifiedPropValues()
|
|
164
|
+
await vueWrapper.setProps({ xLarge })
|
|
165
|
+
expect(findInnerWrapper().classes('x-large')).toBe(true)
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
it('props iconColor, bordered, borderColor, size & widthAuto set attribute style', async () => {
|
|
169
|
+
expect(findInnerWrapper().attributes('style')).toBe('color: #000000;')
|
|
170
|
+
|
|
171
|
+
await vueWrapper.setProps({ iconColor: 'ap-white' })
|
|
172
|
+
expect(findInnerWrapper().attributes('style')).toBe('color: #FFFFFF;')
|
|
173
|
+
|
|
174
|
+
const { bordered } = modifiedPropValues()
|
|
175
|
+
await vueWrapper.setProps({ bordered })
|
|
176
|
+
expect(findInnerWrapper().attributes('style')).toBe('color: #FFFFFF; border-radius: 50%; border: 1px solid #FFFFFF;')
|
|
177
|
+
|
|
178
|
+
const { borderColor } = modifiedPropValues()
|
|
179
|
+
await vueWrapper.setProps({ borderColor })
|
|
180
|
+
expect(findInnerWrapper().attributes('style')).toBe('color: #FFFFFF; border-radius: 50%; border: 1px solid #0C419A;')
|
|
181
|
+
|
|
182
|
+
const { size } = modifiedPropValues()
|
|
183
|
+
await vueWrapper.setProps({ size })
|
|
184
|
+
expect(findInnerWrapper().attributes('style')).toBe('color: #FFFFFF; border-radius: 50%; border: 1px solid #0C419A; height: 4rem; width: 4rem;')
|
|
185
|
+
|
|
186
|
+
const { widthAuto } = modifiedPropValues()
|
|
187
|
+
await vueWrapper.setProps({ widthAuto })
|
|
188
|
+
expect(findInnerWrapper().attributes('style')).toBe('color: #FFFFFF; border-radius: 50%; border: 1px solid #0C419A; height: 4rem; width: auto;')
|
|
189
|
+
})
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
describe('span.amelipro-custom-icon - with slot', () => {
|
|
193
|
+
const findInnerWrapper = () => vueWrapper.find('.amelipro-external-icon')
|
|
194
|
+
|
|
195
|
+
beforeEach(() => {
|
|
196
|
+
vueWrapper = shallowMount(AmeliproIcon, {
|
|
197
|
+
props: requiredPropValues(),
|
|
198
|
+
slots: { default: 'Default slot' },
|
|
199
|
+
})
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
it('prop small sets attribute class', async () => {
|
|
203
|
+
expect(findInnerWrapper().classes('small')).toBe(false)
|
|
204
|
+
|
|
205
|
+
const { small } = modifiedPropValues()
|
|
206
|
+
await vueWrapper.setProps({ small })
|
|
207
|
+
expect(findInnerWrapper().classes('small')).toBe(true)
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
it('prop medium sets attribute class', async () => {
|
|
211
|
+
expect(findInnerWrapper().classes('medium')).toBe(false)
|
|
212
|
+
|
|
213
|
+
const { medium } = modifiedPropValues()
|
|
214
|
+
await vueWrapper.setProps({ medium })
|
|
215
|
+
expect(findInnerWrapper().classes('medium')).toBe(true)
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
it('prop large sets attribute class', async () => {
|
|
219
|
+
expect(findInnerWrapper().classes('large')).toBe(false)
|
|
220
|
+
|
|
221
|
+
const { large } = modifiedPropValues()
|
|
222
|
+
await vueWrapper.setProps({ large })
|
|
223
|
+
expect(findInnerWrapper().classes('large')).toBe(true)
|
|
224
|
+
})
|
|
225
|
+
it('prop xLarge sets attribute class', async () => {
|
|
226
|
+
expect(findInnerWrapper().classes('x-large')).toBe(false)
|
|
227
|
+
|
|
228
|
+
const { xLarge } = modifiedPropValues()
|
|
229
|
+
await vueWrapper.setProps({ xLarge })
|
|
230
|
+
expect(findInnerWrapper().classes('x-large')).toBe(true)
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
it('props iconColor, iconBgColor, bordered, borderColor & size set attribute style', async () => {
|
|
234
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: transparent; border-radius: 50%; color: #000000; padding: 2px;')
|
|
235
|
+
|
|
236
|
+
const { iconBgColor } = modifiedPropValues()
|
|
237
|
+
await vueWrapper.setProps({ iconBgColor })
|
|
238
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: #F0B323; border-radius: 50%; color: #000000; padding: 2px;')
|
|
239
|
+
|
|
240
|
+
const { bordered } = modifiedPropValues()
|
|
241
|
+
await vueWrapper.setProps({ bordered })
|
|
242
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: #F0B323; border-radius: 50%; color: #000000; padding: 2px; border: 1px solid #000000;')
|
|
243
|
+
|
|
244
|
+
await vueWrapper.setProps({ iconColor: 'ap-white' })
|
|
245
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: #F0B323; border-radius: 50%; color: #FFFFFF; padding: 2px; border: 1px solid #FFFFFF;')
|
|
246
|
+
|
|
247
|
+
const { borderColor } = modifiedPropValues()
|
|
248
|
+
await vueWrapper.setProps({ borderColor })
|
|
249
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: #F0B323; border-radius: 50%; color: #FFFFFF; padding: 2px; border: 1px solid #0C419A;')
|
|
250
|
+
|
|
251
|
+
const { size } = modifiedPropValues()
|
|
252
|
+
await vueWrapper.setProps({ size })
|
|
253
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: #F0B323; border-radius: 50%; color: #FFFFFF; padding: 5px; border: 1px solid #0C419A; height: 4rem; width: 4rem;')
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
it('prop small sets padding in attribute style', async () => {
|
|
257
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: transparent; border-radius: 50%; color: #000000; padding: 2px;')
|
|
258
|
+
|
|
259
|
+
const { small } = modifiedPropValues()
|
|
260
|
+
await vueWrapper.setProps({ small })
|
|
261
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: transparent; border-radius: 50%; color: #000000; padding: 1px;')
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
it('prop large sets padding in attribute style', async () => {
|
|
265
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: transparent; border-radius: 50%; color: #000000; padding: 2px;')
|
|
266
|
+
|
|
267
|
+
const { large } = modifiedPropValues()
|
|
268
|
+
await vueWrapper.setProps({ large })
|
|
269
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: transparent; border-radius: 50%; color: #000000; padding: 4px;')
|
|
270
|
+
})
|
|
271
|
+
it('prop xLarge sets padding in attribute style', async () => {
|
|
272
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: transparent; border-radius: 50%; color: #000000; padding: 2px;')
|
|
273
|
+
|
|
274
|
+
const { xLarge } = modifiedPropValues()
|
|
275
|
+
await vueWrapper.setProps({ xLarge })
|
|
276
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: transparent; border-radius: 50%; color: #000000; padding: 5px;')
|
|
277
|
+
})
|
|
278
|
+
|
|
279
|
+
it('prop size sets padding in attribute style', async () => {
|
|
280
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: transparent; border-radius: 50%; color: #000000; padding: 2px;')
|
|
281
|
+
|
|
282
|
+
const { size } = modifiedPropValues()
|
|
283
|
+
await vueWrapper.setProps({ size })
|
|
284
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: transparent; border-radius: 50%; color: #000000; padding: 5px; height: 4rem; width: 4rem;')
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
it('prop mdiPadding set padding in attribute style', async () => {
|
|
288
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: transparent; border-radius: 50%; color: #000000; padding: 2px;')
|
|
289
|
+
|
|
290
|
+
const { mdiPadding } = modifiedPropValues()
|
|
291
|
+
await vueWrapper.setProps({ mdiPadding })
|
|
292
|
+
expect(findInnerWrapper().attributes('style')).toBe('background-color: transparent; border-radius: 50%; color: #000000; padding: 3em;')
|
|
293
|
+
})
|
|
294
|
+
})
|
|
295
|
+
})
|
|
296
|
+
|
|
297
|
+
describe('Setting props should update props or attributes of inner components', () => {
|
|
298
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproIcon>>
|
|
299
|
+
|
|
300
|
+
describe('VIcon', () => {
|
|
301
|
+
beforeEach(() => {
|
|
302
|
+
vueWrapper = shallowMount(AmeliproIcon, {
|
|
303
|
+
props: requiredPropValues(),
|
|
304
|
+
slots: { default: 'Default slot' },
|
|
305
|
+
})
|
|
306
|
+
})
|
|
307
|
+
|
|
308
|
+
it('prop iconColor sets prop color', async () => {
|
|
309
|
+
expect(vueWrapper.findComponent(VIcon).props('color')).toBe('ap-black')
|
|
310
|
+
|
|
311
|
+
const { iconColor } = modifiedPropValues()
|
|
312
|
+
await vueWrapper.setProps({ iconColor })
|
|
313
|
+
expect(vueWrapper.findComponent(VIcon).props('color')).toBe('ap-green')
|
|
314
|
+
})
|
|
315
|
+
})
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
// TODO: pourquoi le slot de VIcon est toujours vide ?
|
|
319
|
+
describe.skip('Slots', () => {
|
|
320
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproIcon>>
|
|
321
|
+
|
|
322
|
+
describe('#default', () => {
|
|
323
|
+
it('slot #default without content', () => {
|
|
324
|
+
vueWrapper = shallowMount(AmeliproIcon, { props: requiredPropValues() })
|
|
325
|
+
expect(vueWrapper.findComponent(VIcon).exists()).toBe(false)
|
|
326
|
+
})
|
|
327
|
+
|
|
328
|
+
it('slot #default with content', () => {
|
|
329
|
+
// vueWrapper = shallowMount(AmeliproIcon, {
|
|
330
|
+
vueWrapper = mount(AmeliproIcon, {
|
|
331
|
+
props: requiredPropValues(),
|
|
332
|
+
slots: { default: 'Default slot content' },
|
|
333
|
+
stubs: { VIcon },
|
|
334
|
+
})
|
|
335
|
+
expect(vueWrapper.find('.amelipro-external-icon').text()).toBe('Default slot content')
|
|
336
|
+
})
|
|
337
|
+
})
|
|
338
|
+
})
|
|
339
|
+
|
|
340
|
+
describe('Computed', () => {
|
|
341
|
+
const vueWrapper = mount(AmeliproIcon, {
|
|
342
|
+
autoAttach: attachToApp(),
|
|
343
|
+
props: {
|
|
344
|
+
...modifiedPropValues(),
|
|
345
|
+
icon: 'utilisateur',
|
|
346
|
+
iconColor: 'ap-blue-darken-1',
|
|
347
|
+
},
|
|
348
|
+
})
|
|
349
|
+
|
|
350
|
+
it('themeIcon returns the good values', () => {
|
|
351
|
+
const expectedResult = `<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="34" height="34" viewBox="0 0 1823 1823" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd">
|
|
352
|
+
<circle class="circle-color" cx="912" cy="912" r="912"></circle>
|
|
353
|
+
<path class="shape-color" d="M962 454c117 0 125 154 125 154v145s1 111-73 152c-2 10-3 20-1 30 4-2-21 146 106 165 92 15 178 57 247 120 23 23 40 186 40 186H418s-2-132 40-186c73-62 162-104 257-120 128-19 85-160 89-158 2-10 1-21-1-31 0 0-69-89-68-169 1-81 0-134 0-134s-4-190 126-190l101 36z"></path>
|
|
354
|
+
</svg>`
|
|
355
|
+
expect(vueWrapper.find('svg').html()).toContain(expectedResult)
|
|
356
|
+
})
|
|
357
|
+
})
|
|
358
|
+
})
|
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`AmeliproIcon >
|
|
3
|
+
exports[`AmeliproIcon > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
4
|
<span
|
|
5
5
|
class="amelipro-icon"
|
|
6
|
-
id="
|
|
6
|
+
id="modified-unique-id"
|
|
7
7
|
>
|
|
8
8
|
<span
|
|
9
9
|
aria-hidden="true"
|
|
10
|
+
aria-label="Modified label"
|
|
10
11
|
class="
|
|
11
12
|
amelipro-custom-icon
|
|
12
13
|
custom-color
|
|
14
|
+
large
|
|
15
|
+
medium
|
|
16
|
+
small
|
|
13
17
|
x-large
|
|
14
18
|
"
|
|
15
19
|
focusable="false"
|
|
16
20
|
role="img"
|
|
17
|
-
style="
|
|
21
|
+
style="
|
|
22
|
+
color: #56C271;
|
|
23
|
+
border-radius: 50%;
|
|
24
|
+
border: 1px solid #0C419A;
|
|
25
|
+
height: 4rem;
|
|
26
|
+
width: auto;
|
|
27
|
+
"
|
|
18
28
|
>
|
|
19
29
|
<span>
|
|
20
30
|
<svg
|
|
@@ -44,3 +54,20 @@ exports[`AmeliproIcon > render correctly 1`] = `
|
|
|
44
54
|
</span>
|
|
45
55
|
</span>
|
|
46
56
|
`;
|
|
57
|
+
|
|
58
|
+
exports[`AmeliproIcon > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
59
|
+
<span class="amelipro-icon">
|
|
60
|
+
<span
|
|
61
|
+
aria-hidden="true"
|
|
62
|
+
class="
|
|
63
|
+
amelipro-custom-icon
|
|
64
|
+
custom-color
|
|
65
|
+
"
|
|
66
|
+
focusable="false"
|
|
67
|
+
role="img"
|
|
68
|
+
style="color: #000000;"
|
|
69
|
+
>
|
|
70
|
+
<!-- v-if -->
|
|
71
|
+
</span>
|
|
72
|
+
</span>
|
|
73
|
+
`;
|