@cnamts/synapse 1.0.11 → 1.0.13
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/dist/{DateFilter-QEfKOz0P.js → DateFilter-_EFzsvvM.js} +1 -1
- package/dist/{NumberFilter-C0h7gVzp.js → NumberFilter-CUxEbKJh.js} +1 -1
- package/dist/{PeriodFilter-8dVrKjju.js → PeriodFilter-D5ueqtKy.js} +1 -1
- package/dist/{SelectFilter-BI3QGbqb.js → SelectFilter-BciBNydy.js} +1 -1
- package/dist/{TextFilter-UOp1hcPp.js → TextFilter-DMN_WAQB.js} +1 -1
- package/dist/components/Amelipro/AmeliproAccordion/AmeliproAccordion.d.ts +7 -3
- package/dist/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/AmeliproAccordionTemplate.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.d.ts +2 -0
- package/dist/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.d.ts +7 -3
- package/dist/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/AmeliproAccordionResultTemplate.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +50 -68
- package/dist/components/Amelipro/AmeliproCard/AmeliproCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIcon/AmeliproIcon.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +5 -5
- package/dist/components/Amelipro/AmeliproMultipleFoldingCard/AmeliproMultipleFoldingCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproNumberedCard/AmeliproNumberedCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.d.ts +24 -32
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.d.ts +36 -48
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +50 -68
- package/dist/components/Amelipro/AmeliproTable/AmeliproTable.d.ts +4 -0
- package/dist/components/Amelipro/AmeliproTable/types.d.ts +11 -0
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +50 -68
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +0 -4
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +12 -16
- package/dist/components/Captcha/Captcha.d.ts +68 -0
- package/dist/components/Captcha/CaptchaAlert.d.ts +13 -0
- package/dist/components/Captcha/CaptchaBase.d.ts +55 -0
- package/dist/components/Captcha/CaptchaBtn.d.ts +12 -0
- package/dist/components/Captcha/CaptchaForm.d.ts +16 -0
- package/dist/components/Captcha/CaptchaImg.d.ts +12 -0
- package/dist/components/Captcha/CaptchaInformation.d.ts +20 -0
- package/dist/components/Captcha/captchaApi.d.ts +41 -0
- package/dist/components/Captcha/icons/volumeUp.d.ts +2 -0
- package/dist/components/Captcha/locales.d.ts +35 -0
- package/dist/components/Captcha/types.d.ts +2 -0
- package/dist/components/ChipList/ChipList.d.ts +2 -2
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +14 -14
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +5 -5
- package/dist/components/Customs/SyForm/SyForm.d.ts +6 -3
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +12 -16
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +96 -68
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +63 -38
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +23 -27
- package/dist/components/DatePicker/composables/useDatePickerViewMode.d.ts +2 -1
- package/dist/components/DatePicker/tests/setup.d.ts +816 -520
- package/dist/components/HeaderToolbar/HeaderToolbar.d.ts +10 -10
- package/dist/components/NirField/NirField.d.ts +31 -34
- package/dist/components/NirField/locales.d.ts +1 -3
- package/dist/components/PasswordField/PasswordField.d.ts +2 -0
- package/dist/components/PeriodField/PeriodField.d.ts +192 -128
- package/dist/components/PhoneField/PhoneField.d.ts +13 -17
- package/dist/components/SearchListField/SearchListField.d.ts +5 -5
- package/dist/components/SyTextArea/SyTextArea.d.ts +0 -4
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +5 -8
- package/dist/components/Tables/SyTable/SyTable.d.ts +5 -8
- package/dist/components/Tables/common/SyTablePagination.d.ts +5 -5
- package/dist/components/Tables/common/types.d.ts +4 -0
- package/dist/components/Tables/common/usePagination.d.ts +3 -4
- package/dist/components/Tables/common/useTableCheckbox.d.ts +10 -6
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/validation/useFormValidation.d.ts +10 -0
- package/dist/composables/validation/useValidatable.d.ts +10 -2
- package/dist/design-system-v3.js +126 -125
- package/dist/design-system-v3.umd.cjs +265 -265
- package/dist/main-DISHlqcd.js +34217 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/assets/overrides/_forms.scss +2 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.stories.ts +7 -4
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.vue +2 -0
- package/src/components/Amelipro/AmeliproAccordionFrieze/AmeliproAccordionFrieze.vue +1 -0
- package/src/components/Amelipro/AmeliproAccordionFrieze/__tests__/__snapshots__/AmeliproAccordionFrieze.spec.ts.snap +574 -112
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.stories.ts +5 -2
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +2 -1
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.stories.ts +6 -3
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.vue +2 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts +5 -2
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +2 -1
- package/src/components/Amelipro/AmeliproCheckbox/__tests__/AmeliproCheckbox.spec.ts +175 -0
- package/src/components/Amelipro/AmeliproCheckbox/__tests__/__snapshots__/AmeliproCheckbox.spec.ts.snap +88 -0
- package/src/components/Amelipro/AmeliproCheckboxGroup/__tests__/AmeliproCheckboxGroup.spec.ts +423 -0
- package/src/components/Amelipro/AmeliproCheckboxGroup/{tests → __tests__}/__snapshots__/AmeliproCheckboxGroup.spec.ts.snap +112 -78
- package/src/components/Amelipro/AmeliproChips/__tests__/AmeliproChips.spec.ts +92 -0
- package/src/components/Amelipro/AmeliproChips/__tests__/__snapshots__/AmeliproChips.spec.ts.snap +81 -0
- package/src/components/Amelipro/AmeliproDialog/__tests__/AmeliproDialog.spec.ts +257 -0
- package/src/components/Amelipro/AmeliproDialog/__tests__/__snapshots__/AmeliproDialog.spec.ts.snap +61 -0
- package/src/components/Amelipro/AmeliproDisclosure/__tests__/AmeliproDisclosure.spec.ts +79 -0
- package/src/components/Amelipro/AmeliproDisclosure/__tests__/__snapshots__/AmeliproDisclosure.spec.ts.snap +89 -0
- package/src/components/Amelipro/AmeliproFooter/AmeliproFooter.vue +6 -7
- package/src/components/Amelipro/AmeliproFooter/__tests__/AmeliproFooter.spec.ts +787 -0
- package/src/components/Amelipro/AmeliproFooter/__tests__/__snapshots__/AmeliproFooter.spec.ts.snap +318 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/AmeliproHeaderBrandSection.spec.ts +167 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +100 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/__tests__/AmeliproHeaderBar.spec.ts +312 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/__tests__/__snapshots__/AmeliproHeaderBar.spec.ts.snap +98 -0
- package/src/components/Amelipro/AmeliproHeader/__tests__/AmeliproHeader.spec.ts +361 -0
- package/src/components/Amelipro/AmeliproHeader/__tests__/__snapshots__/AmeliproHeader.spec.ts.snap +22 -0
- package/src/components/Amelipro/AmeliproMenu/__tests__/AmeliproMenu.spec.ts +168 -0
- package/src/components/Amelipro/AmeliproMenu/__tests__/__snapshots__/AmeliproMenu.spec.ts.snap +295 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/__tests__/AmeliproDropdownMenuBtn.spec.ts +128 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/__tests__/__snapshots__/AmeliproDropdownMenuBtn.spec.ts.snap +67 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/__tests__/AmeliproDropdownMenu.spec.ts +266 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/__tests__/__snapshots__/AmeliproDropdownMenu.spec.ts.snap +134 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/__tests__/AmeliproMessagingMenuBtn.spec.ts +72 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/__tests__/__snapshots__/AmeliproMessagingMenuBtn.spec.ts.snap +71 -0
- package/src/components/Amelipro/AmeliproPageLayout/tests/__snapshots__/AmeliproPageLayout.spec.ts.snap +12 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.stories.ts +81 -9
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +139 -61
- package/src/components/Amelipro/AmeliproTable/__tests__/AmeliproTable.spec.ts +10 -0
- package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +361 -187
- package/src/components/Amelipro/AmeliproTable/types.d.ts +11 -0
- package/src/components/Captcha/Captcha.mdx +72 -0
- package/src/components/Captcha/Captcha.stories.ts +276 -0
- package/src/components/Captcha/Captcha.vue +325 -0
- package/src/components/Captcha/CaptchaAlert.vue +60 -0
- package/src/components/Captcha/CaptchaBase.vue +219 -0
- package/src/components/Captcha/CaptchaBtn.vue +35 -0
- package/src/components/Captcha/CaptchaForm.vue +58 -0
- package/src/components/Captcha/CaptchaImg.vue +41 -0
- package/src/components/Captcha/CaptchaInformation.vue +64 -0
- package/src/components/Captcha/captchaApi.ts +111 -0
- package/src/components/Captcha/icons/volumeUp.vue +11 -0
- package/src/components/Captcha/locales.ts +35 -0
- package/src/components/Captcha/readme.md +5 -0
- package/src/components/Captcha/tests/Captcha.spec.ts +298 -0
- package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +716 -0
- package/src/components/Captcha/types.ts +2 -0
- package/src/components/Customs/Selects/SySelect/SySelect.vue +2 -2
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +4 -0
- package/src/components/Customs/SyForm/SyForm.stories.ts +133 -23
- package/src/components/Customs/SyForm/SyForm.vue +17 -1
- package/src/components/Customs/SyTextField/SyTextField.vue +29 -7
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +32 -9
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +154 -18
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +2 -2
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +35 -4
- package/src/components/DatePicker/composables/tests/useDatePickerViewMode.spec.ts +107 -72
- package/src/components/DatePicker/composables/tests/useMonthButtonCustomization.spec.ts +6 -6
- package/src/components/DatePicker/composables/useDatePickerViewMode.ts +57 -7
- package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +14 -14
- package/src/components/DatePicker/tests/navigation.regression.spec.ts +74 -0
- package/src/components/DatePicker/tests/navigation.simple.spec.ts +137 -0
- package/src/components/NirField/NirField.stories.ts +85 -2
- package/src/components/NirField/NirField.vue +55 -18
- package/src/components/NirField/locales.ts +1 -3
- package/src/components/PasswordField/PasswordField.vue +39 -7
- package/src/components/PhoneField/PhoneField.vue +43 -10
- package/src/components/RangeField/tests/RangeField.spec.ts +0 -3
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +15 -0
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +309 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +18 -3
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +67 -0
- package/src/components/Tables/SyTable/SyTable.mdx +15 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +228 -0
- package/src/components/Tables/SyTable/SyTable.vue +18 -3
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +63 -0
- package/src/components/Tables/common/SyTablePagination.vue +10 -8
- package/src/components/Tables/common/types.ts +4 -0
- package/src/components/Tables/common/usePagination.ts +11 -20
- package/src/components/Tables/common/useTableCheckbox.ts +23 -11
- package/src/components/index.ts +1 -0
- package/src/composables/validation/AvecVosComposants.mdx.old +1 -1
- package/src/composables/validation/FormValidation.stories.ts.old +5 -5
- package/src/composables/validation/useFormValidation.ts +46 -8
- package/src/composables/validation/useValidatable.ts +19 -8
- package/src/stories/Accessibilite/Introduction.mdx +1 -1
- package/src/stories/Demarrer/EnrichirLeDesignSystem.mdx +43 -0
- package/src/stories/Demarrer/EnrichirLeDesignSystem.stories.ts +239 -0
- package/src/stories/Demarrer/SignalerUneAnomalie.mdx +39 -0
- package/src/stories/Demarrer/SignalerUneAnomalie.stories.ts +261 -0
- package/dist/main-DyEOPqqn.js +0 -33329
- package/src/components/Amelipro/AmeliproCheckbox/tests/AmeliproCheckbox.spec.ts +0 -19
- package/src/components/Amelipro/AmeliproCheckbox/tests/__snapshots__/AmeliproCheckbox.spec.ts.snap +0 -40
- package/src/components/Amelipro/AmeliproCheckboxGroup/tests/AmeliproCheckboxGroup.spec.ts +0 -46
- package/src/components/Amelipro/AmeliproChips/tests/AmeliproChips.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproChips/tests/__snapshots__/AmeliproChips.spec.ts.snap +0 -97
- package/src/components/Amelipro/AmeliproDialog/tests/AmeliproDialog.spec.ts +0 -24
- package/src/components/Amelipro/AmeliproDialog/tests/__snapshots__/AmeliproDialog.spec.ts.snap +0 -134
- package/src/components/Amelipro/AmeliproDisclosure/tests/AmeliproDisclosure.spec.ts +0 -19
- package/src/components/Amelipro/AmeliproDisclosure/tests/__snapshots__/AmeliproDisclosure.spec.ts.snap +0 -104
- package/src/components/Amelipro/AmeliproFooter/tests/AmeliproFooter.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproFooter/tests/__snapshots__/AmeliproFooter.spec.ts.snap +0 -432
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/tests/AmeliproHeaderBrandSection.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/tests/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +0 -131
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/tests/AmeliproHeaderBar.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/tests/__snapshots__/AmeliproHeaderBar.spec.ts.snap +0 -172
- package/src/components/Amelipro/AmeliproHeader/tests/AmeliproHeader.spec.ts +0 -159
- package/src/components/Amelipro/AmeliproHeader/tests/__snapshots__/AmeliproHeader.spec.ts.snap +0 -841
- package/src/components/Amelipro/AmeliproMenu/tests/AmeliproMenu.spec.ts +0 -85
- package/src/components/Amelipro/AmeliproMenu/tests/__snapshots__/AmeliproMenu.spec.ts.snap +0 -537
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/tests/AmeliproDropdownMenuBtn.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/tests/__snapshots__/AmeliproDropdownMenuBtn.spec.ts.snap +0 -56
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/tests/AmeliproDropdownMenu.spec.ts +0 -28
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/tests/__snapshots__/AmeliproDropdownMenu.spec.ts.snap +0 -300
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/tests/AmeliproMessagingMenuBtn.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/tests/__snapshots__/AmeliproMessagingMenuBtn.spec.ts.snap +0 -89
- package/src/components/BackBtn/tests/__snapshots__/BackBtn.spec.ts.snap +0 -45
- package/src/components/RangeField/tests/__snapshots__/RangeField.spec.ts.snap +0 -1270
- package/src/stories/Demarrer/CreerUneIssue.mdx +0 -67
- package/src/stories/Demarrer/components.stories.ts +0 -25
|
@@ -0,0 +1,787 @@
|
|
|
1
|
+
import { A11Y_COMPLIANCE_ENUM_VALUES, A11yComplianceEnum } from '../A11yComplianceEnum'
|
|
2
|
+
import { VueWrapper, mount, shallowMount } from '@vue/test-utils'
|
|
3
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
4
|
+
import { AmeliproBtn } from '@/components'
|
|
5
|
+
import AmeliproFooter from '../AmeliproFooter.vue'
|
|
6
|
+
import type { ComponentProps } from 'vue-component-type-helpers'
|
|
7
|
+
import { DisplayTestComponent } from '@tests/helpers/utils'
|
|
8
|
+
import type { ExpectedPropOptions } from '@tests/types'
|
|
9
|
+
import type { PropType } from 'vue'
|
|
10
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
11
|
+
import TestHelper from '@tests/helpers/TestHelper'
|
|
12
|
+
import { propValidator } from '@/utils/propValidator'
|
|
13
|
+
|
|
14
|
+
const expectedPropOptions: ExpectedPropOptions<typeof AmeliproFooter> = {
|
|
15
|
+
a11yCompliance: {
|
|
16
|
+
default: A11yComplianceEnum.NON_COMPLIANT,
|
|
17
|
+
type: String,
|
|
18
|
+
validator: (value: string) => propValidator('a11yCompliance', A11Y_COMPLIANCE_ENUM_VALUES, value),
|
|
19
|
+
},
|
|
20
|
+
a11yHref: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: undefined,
|
|
23
|
+
},
|
|
24
|
+
a11yTarget: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: undefined,
|
|
27
|
+
},
|
|
28
|
+
a11yTo: {
|
|
29
|
+
type: [Array, Object, String] as PropType<RouteLocationRaw>,
|
|
30
|
+
default: undefined,
|
|
31
|
+
},
|
|
32
|
+
aboutHref: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: undefined,
|
|
35
|
+
},
|
|
36
|
+
aboutTarget: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: undefined,
|
|
39
|
+
},
|
|
40
|
+
aboutTo: {
|
|
41
|
+
type: [Array, Object, String] as PropType<RouteLocationRaw>,
|
|
42
|
+
default: undefined,
|
|
43
|
+
},
|
|
44
|
+
backOffice: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
48
|
+
backOfficeText: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: undefined,
|
|
51
|
+
},
|
|
52
|
+
cguHref: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: undefined,
|
|
55
|
+
},
|
|
56
|
+
cguTarget: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: undefined,
|
|
59
|
+
},
|
|
60
|
+
cguTo: {
|
|
61
|
+
type: [Array, Object, String] as PropType<RouteLocationRaw>,
|
|
62
|
+
default: undefined,
|
|
63
|
+
},
|
|
64
|
+
configurationHref: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: undefined,
|
|
67
|
+
},
|
|
68
|
+
configurationLabel: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: 'Configuration',
|
|
71
|
+
},
|
|
72
|
+
configurationTarget: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: undefined,
|
|
75
|
+
},
|
|
76
|
+
configurationTo: {
|
|
77
|
+
type: [Array, Object, String] as PropType<RouteLocationRaw>,
|
|
78
|
+
default: undefined,
|
|
79
|
+
},
|
|
80
|
+
legalNoticeHref: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: undefined,
|
|
83
|
+
},
|
|
84
|
+
legalNoticeTarget: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: undefined,
|
|
87
|
+
},
|
|
88
|
+
legalNoticeTo: {
|
|
89
|
+
type: [Array, Object, String] as PropType<RouteLocationRaw>,
|
|
90
|
+
default: undefined,
|
|
91
|
+
},
|
|
92
|
+
noA11y: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: false,
|
|
95
|
+
},
|
|
96
|
+
noAbout: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: false,
|
|
99
|
+
},
|
|
100
|
+
noCgu: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: false,
|
|
103
|
+
},
|
|
104
|
+
noConfiguration: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: false,
|
|
107
|
+
},
|
|
108
|
+
noLegalNotice: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: false,
|
|
111
|
+
},
|
|
112
|
+
noLinkA11y: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: false,
|
|
115
|
+
},
|
|
116
|
+
noPhone: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: false,
|
|
119
|
+
},
|
|
120
|
+
noSiteMap: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: false,
|
|
123
|
+
},
|
|
124
|
+
phoneLink: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: true,
|
|
127
|
+
},
|
|
128
|
+
siteMapHref: {
|
|
129
|
+
type: String,
|
|
130
|
+
default: undefined,
|
|
131
|
+
},
|
|
132
|
+
siteMapTarget: {
|
|
133
|
+
type: String,
|
|
134
|
+
default: undefined,
|
|
135
|
+
},
|
|
136
|
+
siteMapTo: {
|
|
137
|
+
type: [Array, Object, String] as PropType<RouteLocationRaw>,
|
|
138
|
+
default: undefined,
|
|
139
|
+
},
|
|
140
|
+
uniqueId: {
|
|
141
|
+
type: String,
|
|
142
|
+
default: undefined,
|
|
143
|
+
},
|
|
144
|
+
version: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: 'X.X.X',
|
|
147
|
+
},
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Values pour les props "required"
|
|
151
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproFooter> => ({})
|
|
152
|
+
|
|
153
|
+
// Valeurs pour les props "modified"
|
|
154
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproFooter> => ({
|
|
155
|
+
a11yCompliance: 'partiellement-conforme',
|
|
156
|
+
a11yHref: '#modified-a11y-href',
|
|
157
|
+
a11yTarget: 'modified-a11y-target',
|
|
158
|
+
a11yTo: '/modified-a11y-to',
|
|
159
|
+
aboutHref: '#modified-about-href',
|
|
160
|
+
aboutTarget: 'modified-about-target',
|
|
161
|
+
aboutTo: '/modified-about-to',
|
|
162
|
+
backOffice: true,
|
|
163
|
+
backOfficeText: 'Modified back office text',
|
|
164
|
+
cguHref: '#modified-cgu-href',
|
|
165
|
+
cguTarget: 'modified-cgu-target',
|
|
166
|
+
cguTo: '/modified-cgu-to',
|
|
167
|
+
configurationHref: '#modified-configuration-href',
|
|
168
|
+
configurationLabel: 'Modified configuration label',
|
|
169
|
+
configurationTarget: 'modified-configuration-target',
|
|
170
|
+
configurationTo: '/modified-configuration-to',
|
|
171
|
+
legalNoticeHref: '#modified-legal-notice-href',
|
|
172
|
+
legalNoticeTarget: 'modified-legal-notice-target',
|
|
173
|
+
legalNoticeTo: '/modified-legal-notice-to',
|
|
174
|
+
noA11y: true,
|
|
175
|
+
noAbout: true,
|
|
176
|
+
noCgu: true,
|
|
177
|
+
noConfiguration: true,
|
|
178
|
+
noLegalNotice: true,
|
|
179
|
+
noLinkA11y: true,
|
|
180
|
+
noPhone: true,
|
|
181
|
+
noSiteMap: true,
|
|
182
|
+
phoneLink: false,
|
|
183
|
+
siteMapHref: '#modified-site-map-href',
|
|
184
|
+
siteMapTarget: 'modified-site-map-target',
|
|
185
|
+
siteMapTo: '/modified-site-map-to',
|
|
186
|
+
uniqueId: 'modified-unique-id',
|
|
187
|
+
version: 'Modified version',
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
const testHelper = new TestHelper(AmeliproFooter)
|
|
191
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
192
|
+
.setRequiredPropValues(requiredPropValues)
|
|
193
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
194
|
+
|
|
195
|
+
const displayWrapper = mount(DisplayTestComponent)
|
|
196
|
+
|
|
197
|
+
describe('AmeliproFooter', () => {
|
|
198
|
+
describe('Snapshots', () => {
|
|
199
|
+
testHelper.snapshots()
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
describe('Properties', () => {
|
|
203
|
+
testHelper.properties()
|
|
204
|
+
})
|
|
205
|
+
|
|
206
|
+
describe('Setting props should update props of inner tags', () => {
|
|
207
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproFooter>>
|
|
208
|
+
|
|
209
|
+
beforeEach(() => {
|
|
210
|
+
vueWrapper = shallowMount(AmeliproFooter, { props: requiredPropValues() })
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
describe('footer root', () => {
|
|
214
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
215
|
+
expect(vueWrapper.attributes('id')).toBeUndefined()
|
|
216
|
+
|
|
217
|
+
const { uniqueId } = modifiedPropValues()
|
|
218
|
+
await vueWrapper.setProps({ uniqueId })
|
|
219
|
+
expect(vueWrapper.attributes('id')).toBe('modified-unique-id-container')
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
it('display width sets attribute class', async () => {
|
|
223
|
+
displayWrapper.vm.setWidth(1170)
|
|
224
|
+
await vueWrapper.vm.$nextTick()
|
|
225
|
+
expect(vueWrapper.find('.amelipro-footer').classes('d-flex')).toBe(true)
|
|
226
|
+
|
|
227
|
+
displayWrapper.vm.setWidth(1169)
|
|
228
|
+
await vueWrapper.vm.$nextTick()
|
|
229
|
+
expect(vueWrapper.find('.amelipro-footer').classes('d-block')).toBe(true)
|
|
230
|
+
|
|
231
|
+
displayWrapper.vm.resetDefaults()
|
|
232
|
+
})
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
describe('footer content', () => {
|
|
236
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
237
|
+
expect(vueWrapper.find('.amelipro-footer__content').attributes('id')).toBeUndefined()
|
|
238
|
+
|
|
239
|
+
const { uniqueId } = modifiedPropValues()
|
|
240
|
+
await vueWrapper.setProps({ uniqueId })
|
|
241
|
+
expect(vueWrapper.find('.amelipro-footer__content').attributes('id')).toBe('modified-unique-id-content')
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
it('display width & prop backOffice set attribute class', async () => {
|
|
245
|
+
displayWrapper.vm.setMdAndUp(true)
|
|
246
|
+
await vueWrapper.vm.$nextTick()
|
|
247
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('flex-column')).toBe(false)
|
|
248
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('flex-row')).toBe(true)
|
|
249
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('justify-center')).toBe(false)
|
|
250
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('justify-space-between')).toBe(true)
|
|
251
|
+
|
|
252
|
+
displayWrapper.vm.setMdAndUp(false)
|
|
253
|
+
await vueWrapper.vm.$nextTick()
|
|
254
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('flex-column')).toBe(true)
|
|
255
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('flex-row')).toBe(false)
|
|
256
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('justify-center')).toBe(false)
|
|
257
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('justify-space-between')).toBe(false)
|
|
258
|
+
|
|
259
|
+
const { backOffice } = modifiedPropValues()
|
|
260
|
+
await vueWrapper.setProps({ backOffice })
|
|
261
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('flex-column')).toBe(false)
|
|
262
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('flex-row')).toBe(false)
|
|
263
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('justify-center')).toBe(true)
|
|
264
|
+
expect(vueWrapper.find('.amelipro-footer__content').classes('justify-space-between')).toBe(false)
|
|
265
|
+
|
|
266
|
+
displayWrapper.vm.resetDefaults()
|
|
267
|
+
})
|
|
268
|
+
|
|
269
|
+
it('display width sets attribute style', async () => {
|
|
270
|
+
displayWrapper.vm.setWidth(1000)
|
|
271
|
+
await vueWrapper.vm.$nextTick()
|
|
272
|
+
expect(vueWrapper.find('.amelipro-footer__content').attributes('style')).toBe('width: 100%;')
|
|
273
|
+
|
|
274
|
+
displayWrapper.vm.setWidth(1072)
|
|
275
|
+
await vueWrapper.vm.$nextTick()
|
|
276
|
+
expect(vueWrapper.find('.amelipro-footer__content').attributes('style')).toBe('width: 980px;')
|
|
277
|
+
|
|
278
|
+
displayWrapper.vm.setWidth(1240)
|
|
279
|
+
await vueWrapper.vm.$nextTick()
|
|
280
|
+
expect(vueWrapper.find('.amelipro-footer__content').attributes('style')).toBe('width: 1144px;')
|
|
281
|
+
|
|
282
|
+
displayWrapper.vm.resetDefaults()
|
|
283
|
+
})
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
describe('footer version', () => {
|
|
287
|
+
it('prop backoffice sets footer version visibility', async () => {
|
|
288
|
+
expect(vueWrapper.find('.footer-version').exists()).toBe(true)
|
|
289
|
+
|
|
290
|
+
const { backOffice } = modifiedPropValues()
|
|
291
|
+
await vueWrapper.setProps({ backOffice })
|
|
292
|
+
expect(vueWrapper.find('.footer-version').exists()).toBe(false)
|
|
293
|
+
})
|
|
294
|
+
|
|
295
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
296
|
+
expect(vueWrapper.find('.footer-version').attributes('id')).toBeUndefined()
|
|
297
|
+
|
|
298
|
+
const { uniqueId } = modifiedPropValues()
|
|
299
|
+
await vueWrapper.setProps({ uniqueId })
|
|
300
|
+
expect(vueWrapper.find('.footer-version').attributes('id')).toBe('modified-unique-id-version')
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
it('display width sets attribute class', async () => {
|
|
304
|
+
displayWrapper.vm.setMdAndUp(true)
|
|
305
|
+
await vueWrapper.vm.$nextTick()
|
|
306
|
+
expect(vueWrapper.find('.footer-version').classes('d-none')).toBe(false)
|
|
307
|
+
|
|
308
|
+
displayWrapper.vm.setMdAndUp(false)
|
|
309
|
+
await vueWrapper.vm.$nextTick()
|
|
310
|
+
expect(vueWrapper.find('.footer-version').classes('d-none')).toBe(true)
|
|
311
|
+
|
|
312
|
+
displayWrapper.vm.resetDefaults()
|
|
313
|
+
})
|
|
314
|
+
|
|
315
|
+
it('prop version sets version content', async () => {
|
|
316
|
+
expect(vueWrapper.find('.footer-version').text()).toBe('X.X.X')
|
|
317
|
+
|
|
318
|
+
const { version } = modifiedPropValues()
|
|
319
|
+
await vueWrapper.setProps({ version })
|
|
320
|
+
expect(vueWrapper.find('.footer-version').text()).toBe('Modified version')
|
|
321
|
+
})
|
|
322
|
+
})
|
|
323
|
+
|
|
324
|
+
describe('footer contact', () => {
|
|
325
|
+
it('prop backoffice sets footer contact visibility', async () => {
|
|
326
|
+
expect(vueWrapper.find('.amelipro-footer__contact').exists()).toBe(true)
|
|
327
|
+
|
|
328
|
+
const { backOffice } = modifiedPropValues()
|
|
329
|
+
await vueWrapper.setProps({ backOffice })
|
|
330
|
+
expect(vueWrapper.find('.amelipro-footer__contact').exists()).toBe(false)
|
|
331
|
+
})
|
|
332
|
+
|
|
333
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
334
|
+
expect(vueWrapper.find('.amelipro-footer__contact').attributes('id')).toBeUndefined()
|
|
335
|
+
|
|
336
|
+
const { uniqueId } = modifiedPropValues()
|
|
337
|
+
await vueWrapper.setProps({ uniqueId })
|
|
338
|
+
expect(vueWrapper.find('.amelipro-footer__contact').attributes('id')).toBe('modified-unique-id-contact')
|
|
339
|
+
})
|
|
340
|
+
|
|
341
|
+
it('display width & prop backOffice set attribute class', async () => {
|
|
342
|
+
displayWrapper.vm.setMdAndUp(true)
|
|
343
|
+
await vueWrapper.vm.$nextTick()
|
|
344
|
+
expect(vueWrapper.find('.amelipro-footer__contact').classes('mt-1')).toBe(true)
|
|
345
|
+
expect(vueWrapper.find('.amelipro-footer__contact').classes('mr-4')).toBe(true)
|
|
346
|
+
|
|
347
|
+
displayWrapper.vm.setMdAndUp(false)
|
|
348
|
+
await vueWrapper.vm.$nextTick()
|
|
349
|
+
expect(vueWrapper.find('.amelipro-footer__contact').classes('mt-1')).toBe(false)
|
|
350
|
+
expect(vueWrapper.find('.amelipro-footer__contact').classes('mr-4')).toBe(false)
|
|
351
|
+
|
|
352
|
+
displayWrapper.vm.resetDefaults()
|
|
353
|
+
})
|
|
354
|
+
})
|
|
355
|
+
|
|
356
|
+
describe('footer list', () => {
|
|
357
|
+
it('prop backoffice sets footer list visibility', async () => {
|
|
358
|
+
expect(vueWrapper.find('.amelipro-footer__list').exists()).toBe(true)
|
|
359
|
+
|
|
360
|
+
const { backOffice } = modifiedPropValues()
|
|
361
|
+
await vueWrapper.setProps({ backOffice })
|
|
362
|
+
expect(vueWrapper.find('.amelipro-footer__list').exists()).toBe(false)
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
366
|
+
expect(vueWrapper.find('.amelipro-footer__list').attributes('id')).toBeUndefined()
|
|
367
|
+
|
|
368
|
+
const { uniqueId } = modifiedPropValues()
|
|
369
|
+
await vueWrapper.setProps({ uniqueId })
|
|
370
|
+
expect(vueWrapper.find('.amelipro-footer__list').attributes('id')).toBe('modified-unique-id-list')
|
|
371
|
+
})
|
|
372
|
+
|
|
373
|
+
it('display width & prop backOffice set attribute class', async () => {
|
|
374
|
+
displayWrapper.vm.setMdAndUp(true)
|
|
375
|
+
await vueWrapper.vm.$nextTick()
|
|
376
|
+
expect(vueWrapper.find('.amelipro-footer__list').classes('justify-end')).toBe(true)
|
|
377
|
+
expect(vueWrapper.find('.amelipro-footer__list').classes('justify-center')).toBe(false)
|
|
378
|
+
|
|
379
|
+
displayWrapper.vm.setMdAndUp(false)
|
|
380
|
+
await vueWrapper.vm.$nextTick()
|
|
381
|
+
expect(vueWrapper.find('.amelipro-footer__list').classes('justify-end')).toBe(false)
|
|
382
|
+
expect(vueWrapper.find('.amelipro-footer__list').classes('justify-center')).toBe(true)
|
|
383
|
+
|
|
384
|
+
displayWrapper.vm.resetDefaults()
|
|
385
|
+
})
|
|
386
|
+
})
|
|
387
|
+
|
|
388
|
+
describe('footer a11y text', () => {
|
|
389
|
+
it('props noA11y & noLinkA11y set a11y text visibility', async () => {
|
|
390
|
+
expect(vueWrapper.find('.a11y-text').exists()).toBe(false)
|
|
391
|
+
|
|
392
|
+
const { noA11y, noLinkA11y } = modifiedPropValues()
|
|
393
|
+
await vueWrapper.setProps({ noLinkA11y })
|
|
394
|
+
expect(vueWrapper.find('.a11y-text').exists()).toBe(true)
|
|
395
|
+
|
|
396
|
+
await vueWrapper.setProps({ noA11y })
|
|
397
|
+
expect(vueWrapper.find('.a11y-text').exists()).toBe(false)
|
|
398
|
+
})
|
|
399
|
+
|
|
400
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
401
|
+
const { noLinkA11y } = modifiedPropValues()
|
|
402
|
+
await vueWrapper.setProps({ noLinkA11y })
|
|
403
|
+
expect(vueWrapper.find('.a11y-text').attributes('id')).toBeUndefined()
|
|
404
|
+
|
|
405
|
+
const { uniqueId } = modifiedPropValues()
|
|
406
|
+
await vueWrapper.setProps({ uniqueId })
|
|
407
|
+
expect(vueWrapper.find('.a11y-text').attributes('id')).toBe('modified-unique-id-a11y-text')
|
|
408
|
+
})
|
|
409
|
+
|
|
410
|
+
it('prop a11yCompliance sets a11y text content', async () => {
|
|
411
|
+
const { noLinkA11y } = modifiedPropValues()
|
|
412
|
+
await vueWrapper.setProps({ noLinkA11y })
|
|
413
|
+
|
|
414
|
+
expect(vueWrapper.find('.a11y-text').element.textContent).toContain('Accessibilité\xa0: non conforme')
|
|
415
|
+
|
|
416
|
+
await vueWrapper.setProps({ a11yCompliance: 'partiellement-conforme' })
|
|
417
|
+
expect(vueWrapper.find('.a11y-text').element.textContent).toContain('Accessibilité\xa0: partiellement conforme')
|
|
418
|
+
|
|
419
|
+
await vueWrapper.setProps({ a11yCompliance: 'conforme' })
|
|
420
|
+
expect(vueWrapper.find('.a11y-text').element.textContent).toContain('Accessibilité\xa0: conforme')
|
|
421
|
+
})
|
|
422
|
+
})
|
|
423
|
+
describe('footer backoffice text', () => {
|
|
424
|
+
it('prop backoffice sets footer list visibility', async () => {
|
|
425
|
+
expect(vueWrapper.find('.amelipro-footer__backoffice-text').exists()).toBe(false)
|
|
426
|
+
|
|
427
|
+
const { backOffice } = modifiedPropValues()
|
|
428
|
+
await vueWrapper.setProps({ backOffice })
|
|
429
|
+
expect(vueWrapper.find('.amelipro-footer__backoffice-text').exists()).toBe(true)
|
|
430
|
+
})
|
|
431
|
+
|
|
432
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
433
|
+
const { backOffice, uniqueId } = modifiedPropValues()
|
|
434
|
+
await vueWrapper.setProps({ backOffice })
|
|
435
|
+
|
|
436
|
+
expect(vueWrapper.find('.amelipro-footer__backoffice-text').attributes('id')).toBeUndefined()
|
|
437
|
+
|
|
438
|
+
await vueWrapper.setProps({ uniqueId })
|
|
439
|
+
expect(vueWrapper.find('.amelipro-footer__backoffice-text').attributes('id')).toBe('modified-unique-id-backoffice-text')
|
|
440
|
+
})
|
|
441
|
+
|
|
442
|
+
it('props backOfficeText & version set backoffice text content', async () => {
|
|
443
|
+
const { backOffice, backOfficeText, version } = modifiedPropValues()
|
|
444
|
+
await vueWrapper.setProps({ backOffice })
|
|
445
|
+
|
|
446
|
+
expect(vueWrapper.find('.amelipro-footer__backoffice-text').text()).toBe('CNAM - - Version X.X.X')
|
|
447
|
+
|
|
448
|
+
await vueWrapper.setProps({ backOfficeText })
|
|
449
|
+
expect(vueWrapper.find('.amelipro-footer__backoffice-text').text()).toBe('CNAM - Modified back office text - Version X.X.X')
|
|
450
|
+
|
|
451
|
+
await vueWrapper.setProps({ version })
|
|
452
|
+
expect(vueWrapper.find('.amelipro-footer__backoffice-text').text()).toBe('CNAM - Modified back office text - Version Modified version')
|
|
453
|
+
})
|
|
454
|
+
})
|
|
455
|
+
|
|
456
|
+
describe('footer version mobile', () => {
|
|
457
|
+
it('prop backoffice sets footer version visibility', async () => {
|
|
458
|
+
expect(vueWrapper.find('.footer-version--mobile').exists()).toBe(true)
|
|
459
|
+
|
|
460
|
+
const { backOffice } = modifiedPropValues()
|
|
461
|
+
await vueWrapper.setProps({ backOffice })
|
|
462
|
+
expect(vueWrapper.find('.footer-version--mobile').exists()).toBe(false)
|
|
463
|
+
})
|
|
464
|
+
|
|
465
|
+
it('display width sets attribute class', async () => {
|
|
466
|
+
displayWrapper.vm.setMdAndUp(true)
|
|
467
|
+
await vueWrapper.vm.$nextTick()
|
|
468
|
+
expect(vueWrapper.find('.footer-version--mobile').classes('d-none')).toBe(true)
|
|
469
|
+
expect(vueWrapper.find('.footer-version--mobile').classes('d-flex')).toBe(false)
|
|
470
|
+
|
|
471
|
+
displayWrapper.vm.setMdAndUp(false)
|
|
472
|
+
await vueWrapper.vm.$nextTick()
|
|
473
|
+
expect(vueWrapper.find('.footer-version--mobile').classes('d-none')).toBe(false)
|
|
474
|
+
expect(vueWrapper.find('.footer-version--mobile').classes('d-flex')).toBe(true)
|
|
475
|
+
|
|
476
|
+
displayWrapper.vm.resetDefaults()
|
|
477
|
+
})
|
|
478
|
+
|
|
479
|
+
it('prop uniqueId sets attribute id', async () => {
|
|
480
|
+
expect(vueWrapper.find('.footer-version--mobile p').attributes('id')).toBeUndefined()
|
|
481
|
+
|
|
482
|
+
const { uniqueId } = modifiedPropValues()
|
|
483
|
+
await vueWrapper.setProps({ uniqueId })
|
|
484
|
+
expect(vueWrapper.find('.footer-version--mobile p').attributes('id')).toBe('modified-unique-id-version-mobile')
|
|
485
|
+
})
|
|
486
|
+
|
|
487
|
+
it('prop version sets version content', async () => {
|
|
488
|
+
expect(vueWrapper.find('.footer-version--mobile p').text()).toBe('X.X.X')
|
|
489
|
+
|
|
490
|
+
const { version } = modifiedPropValues()
|
|
491
|
+
await vueWrapper.setProps({ version })
|
|
492
|
+
expect(vueWrapper.find('.footer-version--mobile p').text()).toBe('Modified version')
|
|
493
|
+
})
|
|
494
|
+
})
|
|
495
|
+
})
|
|
496
|
+
|
|
497
|
+
describe('Setting props should update props or attributes of inner components', () => {
|
|
498
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproFooter>>
|
|
499
|
+
|
|
500
|
+
beforeEach(() => {
|
|
501
|
+
vueWrapper = shallowMount(AmeliproFooter, { props: requiredPropValues() })
|
|
502
|
+
})
|
|
503
|
+
|
|
504
|
+
describe('AmeliproBtn site map', () => {
|
|
505
|
+
const findBtn = () => vueWrapper.findComponent<typeof AmeliproBtn>('.amelipro-footer__site-map-btn')
|
|
506
|
+
it('prop noSiteMap sets btn visibility', async () => {
|
|
507
|
+
expect(findBtn().exists()).toBe(true)
|
|
508
|
+
|
|
509
|
+
const { noSiteMap } = modifiedPropValues()
|
|
510
|
+
await vueWrapper.setProps({ noSiteMap })
|
|
511
|
+
expect(findBtn().exists()).toBe(false)
|
|
512
|
+
})
|
|
513
|
+
|
|
514
|
+
it('prop uniqueId sets prop uniqueId', async () => {
|
|
515
|
+
expect(findBtn().props('uniqueId')).toBe(testHelper.default('uniqueId'))
|
|
516
|
+
|
|
517
|
+
const { uniqueId } = modifiedPropValues()
|
|
518
|
+
await vueWrapper.setProps({ uniqueId })
|
|
519
|
+
expect(findBtn().props('uniqueId')).toBe(`${testHelper.modified('uniqueId')}-site-map-btn`)
|
|
520
|
+
})
|
|
521
|
+
|
|
522
|
+
it('prop siteMapHref sets attribute href', async () => {
|
|
523
|
+
expect(findBtn().attributes('href')).toBe(testHelper.default('siteMapHref'))
|
|
524
|
+
|
|
525
|
+
const { siteMapHref } = modifiedPropValues()
|
|
526
|
+
await vueWrapper.setProps({ siteMapHref })
|
|
527
|
+
expect(findBtn().attributes('href')).toBe(testHelper.modified('siteMapHref'))
|
|
528
|
+
})
|
|
529
|
+
|
|
530
|
+
it('prop siteMapTarget sets attribute target', async () => {
|
|
531
|
+
expect(findBtn().attributes('target')).toBe(testHelper.default('siteMapTarget'))
|
|
532
|
+
|
|
533
|
+
const { siteMapTarget } = modifiedPropValues()
|
|
534
|
+
await vueWrapper.setProps({ siteMapTarget })
|
|
535
|
+
expect(findBtn().attributes('target')).toBe(testHelper.modified('siteMapTarget'))
|
|
536
|
+
})
|
|
537
|
+
|
|
538
|
+
it('prop siteMapTo sets attribute to', async () => {
|
|
539
|
+
expect(findBtn().attributes('to')).toBe(testHelper.default('siteMapTo'))
|
|
540
|
+
|
|
541
|
+
const { siteMapTo } = modifiedPropValues()
|
|
542
|
+
await vueWrapper.setProps({ siteMapTo })
|
|
543
|
+
expect(findBtn().attributes('to')).toBe(testHelper.modified('siteMapTo'))
|
|
544
|
+
})
|
|
545
|
+
})
|
|
546
|
+
|
|
547
|
+
describe('AmeliproBtn configuration', () => {
|
|
548
|
+
const findBtn = () => vueWrapper.findComponent<typeof AmeliproBtn>('.amelipro-footer__config-btn')
|
|
549
|
+
it('prop noConfiguration sets btn visibility', async () => {
|
|
550
|
+
expect(findBtn().exists()).toBe(true)
|
|
551
|
+
|
|
552
|
+
const { noConfiguration } = modifiedPropValues()
|
|
553
|
+
await vueWrapper.setProps({ noConfiguration })
|
|
554
|
+
expect(findBtn().exists()).toBe(false)
|
|
555
|
+
})
|
|
556
|
+
|
|
557
|
+
it('prop uniqueId sets prop id', async () => {
|
|
558
|
+
expect(findBtn().props('uniqueId')).toBe(testHelper.default('uniqueId'))
|
|
559
|
+
|
|
560
|
+
const { uniqueId } = modifiedPropValues()
|
|
561
|
+
await vueWrapper.setProps({ uniqueId })
|
|
562
|
+
expect(findBtn().props('uniqueId')).toBe(`${testHelper.modified('uniqueId')}-config-btn`)
|
|
563
|
+
})
|
|
564
|
+
|
|
565
|
+
it('prop configurationHref sets attribute href', async () => {
|
|
566
|
+
expect(findBtn().attributes('href')).toBe(testHelper.default('configurationHref'))
|
|
567
|
+
|
|
568
|
+
const { configurationHref } = modifiedPropValues()
|
|
569
|
+
await vueWrapper.setProps({ configurationHref })
|
|
570
|
+
expect(findBtn().attributes('href')).toBe(testHelper.modified('configurationHref'))
|
|
571
|
+
})
|
|
572
|
+
|
|
573
|
+
// TODO: pourquoi ce test ne passe-t-il pas ?
|
|
574
|
+
it.skip('prop configurationLabel sets label text', async () => {
|
|
575
|
+
expect(findBtn().text()).toBe(testHelper.default('configurationLabel'))
|
|
576
|
+
|
|
577
|
+
const { configurationLabel } = modifiedPropValues()
|
|
578
|
+
await vueWrapper.setProps({ configurationLabel })
|
|
579
|
+
expect(findBtn().text()).toBe(testHelper.modified('configurationLabel'))
|
|
580
|
+
})
|
|
581
|
+
|
|
582
|
+
it('prop configurationTarget sets attribute target', async () => {
|
|
583
|
+
expect(findBtn().attributes('target')).toBe(testHelper.default('configurationTarget'))
|
|
584
|
+
|
|
585
|
+
const { configurationTarget } = modifiedPropValues()
|
|
586
|
+
await vueWrapper.setProps({ configurationTarget })
|
|
587
|
+
expect(findBtn().attributes('target')).toBe(testHelper.modified('configurationTarget'))
|
|
588
|
+
})
|
|
589
|
+
|
|
590
|
+
it('prop configurationTo sets attribute to', async () => {
|
|
591
|
+
expect(findBtn().attributes('to')).toBe(testHelper.default('configurationTo'))
|
|
592
|
+
|
|
593
|
+
const { configurationTo } = modifiedPropValues()
|
|
594
|
+
await vueWrapper.setProps({ configurationTo })
|
|
595
|
+
expect(findBtn().attributes('to')).toBe(testHelper.modified('configurationTo'))
|
|
596
|
+
})
|
|
597
|
+
})
|
|
598
|
+
|
|
599
|
+
describe('AmeliproBtn legal notice', () => {
|
|
600
|
+
const findBtn = () => vueWrapper.findComponent<typeof AmeliproBtn>('.amelipro-footer__legal-notice-btn')
|
|
601
|
+
it('prop noLegalNotice sets btn visibility', async () => {
|
|
602
|
+
expect(findBtn().exists()).toBe(true)
|
|
603
|
+
|
|
604
|
+
const { noLegalNotice } = modifiedPropValues()
|
|
605
|
+
await vueWrapper.setProps({ noLegalNotice })
|
|
606
|
+
expect(findBtn().exists()).toBe(false)
|
|
607
|
+
})
|
|
608
|
+
|
|
609
|
+
it('prop uniqueId sets prop id', async () => {
|
|
610
|
+
expect(findBtn().props('uniqueId')).toBe(testHelper.default('uniqueId'))
|
|
611
|
+
|
|
612
|
+
const { uniqueId } = modifiedPropValues()
|
|
613
|
+
await vueWrapper.setProps({ uniqueId })
|
|
614
|
+
expect(findBtn().props('uniqueId')).toBe(`${testHelper.modified('uniqueId')}-legal-notice-btn`)
|
|
615
|
+
})
|
|
616
|
+
|
|
617
|
+
it('prop legalNoticeHref sets attribute href', async () => {
|
|
618
|
+
expect(findBtn().attributes('href')).toBe(testHelper.default('legalNoticeHref'))
|
|
619
|
+
|
|
620
|
+
const { legalNoticeHref } = modifiedPropValues()
|
|
621
|
+
await vueWrapper.setProps({ legalNoticeHref })
|
|
622
|
+
expect(findBtn().attributes('href')).toBe(testHelper.modified('legalNoticeHref'))
|
|
623
|
+
})
|
|
624
|
+
|
|
625
|
+
it('prop legalNoticeTarget sets attribute target', async () => {
|
|
626
|
+
expect(findBtn().attributes('target')).toBe(testHelper.default('legalNoticeTarget'))
|
|
627
|
+
|
|
628
|
+
const { legalNoticeTarget } = modifiedPropValues()
|
|
629
|
+
await vueWrapper.setProps({ legalNoticeTarget })
|
|
630
|
+
expect(findBtn().attributes('target')).toBe(testHelper.modified('legalNoticeTarget'))
|
|
631
|
+
})
|
|
632
|
+
|
|
633
|
+
it('prop legalNoticeTo sets attribute to', async () => {
|
|
634
|
+
expect(findBtn().attributes('to')).toBe(testHelper.default('legalNoticeTo'))
|
|
635
|
+
|
|
636
|
+
const { legalNoticeTo } = modifiedPropValues()
|
|
637
|
+
await vueWrapper.setProps({ legalNoticeTo })
|
|
638
|
+
expect(findBtn().attributes('to')).toBe(testHelper.modified('legalNoticeTo'))
|
|
639
|
+
})
|
|
640
|
+
})
|
|
641
|
+
|
|
642
|
+
describe('AmeliproBtn CGU', () => {
|
|
643
|
+
const findBtn = () => vueWrapper.findComponent<typeof AmeliproBtn>('.amelipro-footer__cgu-btn')
|
|
644
|
+
it('prop noCgu sets btn visibility', async () => {
|
|
645
|
+
expect(findBtn().exists()).toBe(true)
|
|
646
|
+
|
|
647
|
+
const { noCgu } = modifiedPropValues()
|
|
648
|
+
await vueWrapper.setProps({ noCgu })
|
|
649
|
+
expect(findBtn().exists()).toBe(false)
|
|
650
|
+
})
|
|
651
|
+
|
|
652
|
+
it('prop uniqueId sets prop id', async () => {
|
|
653
|
+
expect(findBtn().props('uniqueId')).toBe(testHelper.default('uniqueId'))
|
|
654
|
+
|
|
655
|
+
const { uniqueId } = modifiedPropValues()
|
|
656
|
+
await vueWrapper.setProps({ uniqueId })
|
|
657
|
+
expect(findBtn().props('uniqueId')).toBe(`${testHelper.modified('uniqueId')}-cgu-btn`)
|
|
658
|
+
})
|
|
659
|
+
|
|
660
|
+
it('prop cguHref sets attribute href', async () => {
|
|
661
|
+
expect(findBtn().attributes('href')).toBe(testHelper.default('cguHref'))
|
|
662
|
+
|
|
663
|
+
const { cguHref } = modifiedPropValues()
|
|
664
|
+
await vueWrapper.setProps({ cguHref })
|
|
665
|
+
expect(findBtn().attributes('href')).toBe(testHelper.modified('cguHref'))
|
|
666
|
+
})
|
|
667
|
+
|
|
668
|
+
it('prop cguTarget sets attribute target', async () => {
|
|
669
|
+
expect(findBtn().attributes('target')).toBe(testHelper.default('cguTarget'))
|
|
670
|
+
|
|
671
|
+
const { cguTarget } = modifiedPropValues()
|
|
672
|
+
await vueWrapper.setProps({ cguTarget })
|
|
673
|
+
expect(findBtn().attributes('target')).toBe(testHelper.modified('cguTarget'))
|
|
674
|
+
})
|
|
675
|
+
|
|
676
|
+
it('prop cguTo sets attribute to', async () => {
|
|
677
|
+
expect(findBtn().attributes('to')).toBe(testHelper.default('cguTo'))
|
|
678
|
+
|
|
679
|
+
const { cguTo } = modifiedPropValues()
|
|
680
|
+
await vueWrapper.setProps({ cguTo })
|
|
681
|
+
expect(findBtn().attributes('to')).toBe(testHelper.modified('cguTo'))
|
|
682
|
+
})
|
|
683
|
+
})
|
|
684
|
+
|
|
685
|
+
describe('AmeliproBtn a11y link', () => {
|
|
686
|
+
const findBtn = () => vueWrapper.findComponent<typeof AmeliproBtn>('.amelipro-footer__a11y-btn')
|
|
687
|
+
it('props noA11y & noLinkA11y set btn visibility', async () => {
|
|
688
|
+
expect(findBtn().exists()).toBe(true)
|
|
689
|
+
|
|
690
|
+
const { noA11y, noLinkA11y } = modifiedPropValues()
|
|
691
|
+
await vueWrapper.setProps({ noLinkA11y })
|
|
692
|
+
expect(findBtn().exists()).toBe(false)
|
|
693
|
+
|
|
694
|
+
await vueWrapper.setProps({ noA11y, noLinkA11y: false })
|
|
695
|
+
expect(findBtn().exists()).toBe(false)
|
|
696
|
+
})
|
|
697
|
+
|
|
698
|
+
it('prop uniqueId sets prop id', async () => {
|
|
699
|
+
expect(findBtn().props('uniqueId')).toBe(testHelper.default('uniqueId'))
|
|
700
|
+
|
|
701
|
+
const { uniqueId } = modifiedPropValues()
|
|
702
|
+
await vueWrapper.setProps({ uniqueId })
|
|
703
|
+
expect(findBtn().props('uniqueId')).toBe(`${testHelper.modified('uniqueId')}-a11y-btn`)
|
|
704
|
+
})
|
|
705
|
+
|
|
706
|
+
it('prop a11yHref sets attribute href', async () => {
|
|
707
|
+
expect(findBtn().attributes('href')).toBe(testHelper.default('a11yHref'))
|
|
708
|
+
|
|
709
|
+
const { a11yHref } = modifiedPropValues()
|
|
710
|
+
await vueWrapper.setProps({ a11yHref })
|
|
711
|
+
expect(findBtn().attributes('href')).toBe(testHelper.modified('a11yHref'))
|
|
712
|
+
})
|
|
713
|
+
|
|
714
|
+
it('prop a11yTarget sets attribute target', async () => {
|
|
715
|
+
expect(findBtn().attributes('target')).toBe(testHelper.default('a11yTarget'))
|
|
716
|
+
|
|
717
|
+
const { a11yTarget } = modifiedPropValues()
|
|
718
|
+
await vueWrapper.setProps({ a11yTarget })
|
|
719
|
+
expect(findBtn().attributes('target')).toBe(testHelper.modified('a11yTarget'))
|
|
720
|
+
})
|
|
721
|
+
|
|
722
|
+
it('prop a11yTo sets attribute to', async () => {
|
|
723
|
+
expect(findBtn().attributes('to')).toBe(testHelper.default('a11yTo'))
|
|
724
|
+
|
|
725
|
+
const { a11yTo } = modifiedPropValues()
|
|
726
|
+
await vueWrapper.setProps({ a11yTo })
|
|
727
|
+
expect(findBtn().attributes('to')).toBe(testHelper.modified('a11yTo'))
|
|
728
|
+
})
|
|
729
|
+
})
|
|
730
|
+
})
|
|
731
|
+
|
|
732
|
+
// TODO: réparer ces tests
|
|
733
|
+
describe.skip('Events', () => {
|
|
734
|
+
let vueWrapper: VueWrapper<InstanceType<typeof AmeliproFooter>>
|
|
735
|
+
|
|
736
|
+
const buttonFinder = (n: number) => vueWrapper.findAllComponents(AmeliproBtn).at(n)
|
|
737
|
+
|
|
738
|
+
beforeEach(() => {
|
|
739
|
+
vueWrapper = shallowMount(AmeliproFooter, { props: requiredPropValues() })
|
|
740
|
+
})
|
|
741
|
+
|
|
742
|
+
it('test siteMapEvent', async () => {
|
|
743
|
+
expect(vueWrapper.emitted('site-map-event')).toStrictEqual(undefined)
|
|
744
|
+
expect(buttonFinder(0)?.exists()).toBe(true)
|
|
745
|
+
await buttonFinder(0)?.trigger('click')
|
|
746
|
+
expect(vueWrapper.emitted('site-map-event')).toStrictEqual([[]])
|
|
747
|
+
})
|
|
748
|
+
|
|
749
|
+
it('test aboutEvent', async () => {
|
|
750
|
+
expect(vueWrapper.emitted('about-event')).toStrictEqual(undefined)
|
|
751
|
+
await buttonFinder(1)?.trigger('click')
|
|
752
|
+
expect(vueWrapper.emitted('about-event')).toStrictEqual([[]])
|
|
753
|
+
})
|
|
754
|
+
|
|
755
|
+
it('test configEvent', async () => {
|
|
756
|
+
expect(vueWrapper.emitted('config-event')).toStrictEqual(undefined)
|
|
757
|
+
await buttonFinder(2)?.trigger('click')
|
|
758
|
+
expect(vueWrapper.emitted('config-event')).toStrictEqual([[]])
|
|
759
|
+
})
|
|
760
|
+
|
|
761
|
+
it('test legalNoticeEvent', async () => {
|
|
762
|
+
expect(vueWrapper.emitted('legal-notice-event')).toStrictEqual(undefined)
|
|
763
|
+
await buttonFinder(3)?.trigger('click')
|
|
764
|
+
expect(vueWrapper.emitted('legal-notice-event')).toStrictEqual([[]])
|
|
765
|
+
})
|
|
766
|
+
|
|
767
|
+
it('test cguEvent', async () => {
|
|
768
|
+
expect(vueWrapper.emitted('cgu-event')).toStrictEqual(undefined)
|
|
769
|
+
await buttonFinder(4)?.trigger('click')
|
|
770
|
+
expect(vueWrapper.emitted('cgu-event')).toStrictEqual([[]])
|
|
771
|
+
})
|
|
772
|
+
|
|
773
|
+
it('test a11yEvent', async () => {
|
|
774
|
+
expect(vueWrapper.emitted('a11y-event')).toStrictEqual(undefined)
|
|
775
|
+
await buttonFinder(5)?.trigger('click')
|
|
776
|
+
expect(vueWrapper.emitted('a11y-event')).toStrictEqual([[]])
|
|
777
|
+
})
|
|
778
|
+
})
|
|
779
|
+
|
|
780
|
+
// describe('Slots', () => {
|
|
781
|
+
// describe.todo('AmeliproBtn site map #default')
|
|
782
|
+
// describe.todo('AmeliproBtn configuration #default')
|
|
783
|
+
// describe.todo('AmeliproBtn legal notice #default')
|
|
784
|
+
// describe.todo('AmeliproBtn CGU #default')
|
|
785
|
+
// describe.todo('AmeliproBtn a11y link #default')
|
|
786
|
+
// })
|
|
787
|
+
})
|