@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
|
@@ -6,155 +6,190 @@ vi.mock('vue', async () => {
|
|
|
6
6
|
const actual = await vi.importActual('vue')
|
|
7
7
|
return {
|
|
8
8
|
...actual,
|
|
9
|
-
watch: vi.fn(
|
|
10
|
-
// Stocker le callback pour pouvoir le déclencher manuellement dans les tests
|
|
11
|
-
watchCallback = callback
|
|
12
|
-
}),
|
|
9
|
+
watch: vi.fn(),
|
|
13
10
|
}
|
|
14
11
|
})
|
|
15
12
|
|
|
16
|
-
// Variable pour stocker le callback de watch
|
|
17
|
-
let watchCallback: ((newValue: boolean) => void) | null = null
|
|
18
|
-
|
|
19
13
|
describe('useDatePickerViewMode', () => {
|
|
20
14
|
// Mocks et setup
|
|
21
15
|
let isBirthDate = false
|
|
16
|
+
let selectedDate: Date | (Date | null)[] | null = null
|
|
22
17
|
const mockIsBirthDateGetter = vi.fn(() => isBirthDate)
|
|
18
|
+
const mockSelectedDateGetter = vi.fn(() => selectedDate)
|
|
23
19
|
|
|
24
20
|
beforeEach(() => {
|
|
25
21
|
// Réinitialiser les mocks avant chaque test
|
|
26
22
|
mockIsBirthDateGetter.mockClear()
|
|
23
|
+
mockSelectedDateGetter.mockClear()
|
|
27
24
|
isBirthDate = false
|
|
28
|
-
|
|
25
|
+
selectedDate = null
|
|
29
26
|
})
|
|
30
27
|
|
|
31
28
|
it('devrait initialiser currentViewMode à "month" si isBirthDate est false', () => {
|
|
32
|
-
const { currentViewMode } = useDatePickerViewMode(mockIsBirthDateGetter)
|
|
29
|
+
const { currentViewMode } = useDatePickerViewMode(mockIsBirthDateGetter, mockSelectedDateGetter)
|
|
33
30
|
|
|
34
31
|
expect(currentViewMode.value).toBe('month')
|
|
35
32
|
expect(mockIsBirthDateGetter).toHaveBeenCalled()
|
|
33
|
+
// Note: mockSelectedDateGetter n'est pas appelé car isBirthDateGetter() retourne false
|
|
34
|
+
// et l'évaluation court-circuite (false && !selectedDateGetter() n'évalue pas selectedDateGetter())
|
|
35
|
+
expect(mockSelectedDateGetter).not.toHaveBeenCalled()
|
|
36
36
|
})
|
|
37
37
|
|
|
38
|
-
it('devrait initialiser currentViewMode à "year" si isBirthDate est true', () => {
|
|
38
|
+
it('devrait initialiser currentViewMode à "year" si isBirthDate est true et aucune date sélectionnée', () => {
|
|
39
39
|
isBirthDate = true
|
|
40
40
|
|
|
41
|
-
const { currentViewMode } = useDatePickerViewMode(mockIsBirthDateGetter)
|
|
41
|
+
const { currentViewMode } = useDatePickerViewMode(mockIsBirthDateGetter, mockSelectedDateGetter)
|
|
42
42
|
|
|
43
43
|
expect(currentViewMode.value).toBe('year')
|
|
44
44
|
expect(mockIsBirthDateGetter).toHaveBeenCalled()
|
|
45
|
+
expect(mockSelectedDateGetter).toHaveBeenCalled()
|
|
45
46
|
})
|
|
46
47
|
|
|
47
|
-
it('devrait
|
|
48
|
-
|
|
48
|
+
it('devrait initialiser currentViewMode à "month" si isBirthDate est true et une date est sélectionnée', () => {
|
|
49
|
+
isBirthDate = true
|
|
50
|
+
selectedDate = new Date('2024-01-15')
|
|
51
|
+
|
|
52
|
+
const { currentViewMode } = useDatePickerViewMode(mockIsBirthDateGetter, mockSelectedDateGetter)
|
|
49
53
|
|
|
50
|
-
// Initialement, currentViewMode devrait être 'month'
|
|
51
54
|
expect(currentViewMode.value).toBe('month')
|
|
55
|
+
expect(mockIsBirthDateGetter).toHaveBeenCalled()
|
|
56
|
+
expect(mockSelectedDateGetter).toHaveBeenCalled()
|
|
57
|
+
})
|
|
52
58
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
59
|
+
describe('resetViewMode', () => {
|
|
60
|
+
it('devrait réinitialiser currentViewMode à "month" si isBirthDate est false', () => {
|
|
61
|
+
const { currentViewMode, handleViewModeUpdate, resetViewMode } = useDatePickerViewMode(mockIsBirthDateGetter, mockSelectedDateGetter)
|
|
57
62
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
})
|
|
63
|
+
// Mettre à jour le mode d'affichage à 'year'
|
|
64
|
+
handleViewModeUpdate('year')
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const { currentViewMode, handleViewModeUpdate } = useDatePickerViewMode(mockIsBirthDateGetter)
|
|
66
|
+
// Réinitialiser le mode d'affichage
|
|
67
|
+
resetViewMode()
|
|
65
68
|
|
|
66
|
-
//
|
|
69
|
+
// currentViewMode devrait être réinitialisé à 'month'
|
|
67
70
|
expect(currentViewMode.value).toBe('month')
|
|
71
|
+
})
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
it('devrait réinitialiser currentViewMode à "year" si isBirthDate est true et aucune date sélectionnée', () => {
|
|
74
|
+
isBirthDate = true
|
|
75
|
+
|
|
76
|
+
const { currentViewMode, handleViewModeUpdate, resetViewMode } = useDatePickerViewMode(mockIsBirthDateGetter, mockSelectedDateGetter)
|
|
77
|
+
|
|
78
|
+
// Mettre à jour le mode d'affichage à 'months'
|
|
79
|
+
handleViewModeUpdate('months')
|
|
71
80
|
|
|
72
|
-
//
|
|
81
|
+
// Réinitialiser le mode d'affichage
|
|
82
|
+
resetViewMode()
|
|
83
|
+
|
|
84
|
+
// currentViewMode devrait être réinitialisé à 'year'
|
|
73
85
|
expect(currentViewMode.value).toBe('year')
|
|
74
86
|
})
|
|
75
|
-
})
|
|
76
87
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
it('devrait réinitialiser currentViewMode à "month" si isBirthDate est true et une date est sélectionnée', () => {
|
|
89
|
+
isBirthDate = true
|
|
90
|
+
selectedDate = new Date('2024-01-15')
|
|
91
|
+
|
|
92
|
+
const { currentViewMode, handleViewModeUpdate, resetViewMode } = useDatePickerViewMode(mockIsBirthDateGetter, mockSelectedDateGetter)
|
|
80
93
|
|
|
81
94
|
// Mettre à jour le mode d'affichage à 'year'
|
|
82
95
|
handleViewModeUpdate('year')
|
|
83
96
|
|
|
84
|
-
//
|
|
85
|
-
|
|
97
|
+
// Réinitialiser le mode d'affichage
|
|
98
|
+
resetViewMode()
|
|
86
99
|
|
|
87
|
-
// currentViewMode
|
|
88
|
-
expect(currentViewMode.value).toBe('
|
|
100
|
+
// currentViewMode devrait être réinitialisé à 'month' (car une date est sélectionnée)
|
|
101
|
+
expect(currentViewMode.value).toBe('month')
|
|
89
102
|
})
|
|
103
|
+
})
|
|
90
104
|
|
|
91
|
-
|
|
105
|
+
describe('Navigation Regression Tests', () => {
|
|
106
|
+
it('should handle year update correctly in birth date mode', () => {
|
|
92
107
|
isBirthDate = true
|
|
93
108
|
|
|
94
|
-
const { currentViewMode, handleYearUpdate } = useDatePickerViewMode(mockIsBirthDateGetter)
|
|
109
|
+
const { currentViewMode, handleYearUpdate } = useDatePickerViewMode(mockIsBirthDateGetter, mockSelectedDateGetter)
|
|
95
110
|
|
|
96
|
-
//
|
|
111
|
+
// Initialement en mode year
|
|
112
|
+
expect(currentViewMode.value).toBe('year')
|
|
113
|
+
|
|
114
|
+
// Simuler la sélection d'une année
|
|
97
115
|
handleYearUpdate()
|
|
98
116
|
|
|
99
|
-
//
|
|
117
|
+
// Devrait passer en mode months
|
|
100
118
|
expect(currentViewMode.value).toBe('months')
|
|
101
119
|
})
|
|
102
|
-
})
|
|
103
120
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const { currentViewMode, handleViewModeUpdate, handleMonthUpdate } = useDatePickerViewMode(mockIsBirthDateGetter)
|
|
121
|
+
it('should handle month update correctly in birth date mode', () => {
|
|
122
|
+
isBirthDate = true
|
|
107
123
|
|
|
108
|
-
|
|
109
|
-
handleViewModeUpdate('months')
|
|
124
|
+
const { currentViewMode, handleYearUpdate, handleMonthUpdate } = useDatePickerViewMode(mockIsBirthDateGetter, mockSelectedDateGetter)
|
|
110
125
|
|
|
111
|
-
//
|
|
126
|
+
// Passer en mode months (après sélection année)
|
|
127
|
+
handleYearUpdate()
|
|
128
|
+
expect(currentViewMode.value).toBe('months')
|
|
129
|
+
|
|
130
|
+
// Simuler la sélection d'un mois
|
|
112
131
|
handleMonthUpdate()
|
|
113
132
|
|
|
114
|
-
//
|
|
115
|
-
expect(currentViewMode.value).toBe('
|
|
133
|
+
// Devrait passer en mode month (calendrier)
|
|
134
|
+
expect(currentViewMode.value).toBe('month')
|
|
116
135
|
})
|
|
117
136
|
|
|
118
|
-
it('
|
|
119
|
-
isBirthDate =
|
|
137
|
+
it('should not update view mode in non-birth date mode', () => {
|
|
138
|
+
isBirthDate = false
|
|
120
139
|
|
|
121
|
-
const { currentViewMode, handleMonthUpdate } = useDatePickerViewMode(mockIsBirthDateGetter)
|
|
140
|
+
const { currentViewMode, handleYearUpdate, handleMonthUpdate } = useDatePickerViewMode(mockIsBirthDateGetter, mockSelectedDateGetter)
|
|
122
141
|
|
|
123
|
-
//
|
|
124
|
-
|
|
142
|
+
// Initialement en mode month
|
|
143
|
+
expect(currentViewMode.value).toBe('month')
|
|
125
144
|
|
|
126
|
-
//
|
|
127
|
-
|
|
145
|
+
// Les handlers ne devraient pas changer le mode en mode normal
|
|
146
|
+
handleYearUpdate()
|
|
147
|
+
expect(currentViewMode.value).toBe('month')
|
|
148
|
+
|
|
149
|
+
handleMonthUpdate()
|
|
150
|
+
expect(currentViewMode.value).toBe('month')
|
|
128
151
|
})
|
|
129
|
-
})
|
|
130
152
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const { currentViewMode, handleViewModeUpdate, resetViewMode } = useDatePickerViewMode(mockIsBirthDateGetter)
|
|
153
|
+
it('should handle complete navigation cycle correctly', () => {
|
|
154
|
+
isBirthDate = true
|
|
134
155
|
|
|
135
|
-
|
|
136
|
-
handleViewModeUpdate('year')
|
|
156
|
+
const { currentViewMode, handleYearUpdate, handleMonthUpdate, resetViewMode } = useDatePickerViewMode(mockIsBirthDateGetter, mockSelectedDateGetter)
|
|
137
157
|
|
|
138
|
-
//
|
|
158
|
+
// Cycle complet : year → months → month → reset → year
|
|
159
|
+
expect(currentViewMode.value).toBe('year')
|
|
160
|
+
|
|
161
|
+
handleYearUpdate()
|
|
162
|
+
expect(currentViewMode.value).toBe('months')
|
|
163
|
+
|
|
164
|
+
handleMonthUpdate()
|
|
165
|
+
expect(currentViewMode.value).toBe('month')
|
|
166
|
+
|
|
167
|
+
// Simuler fermeture/réouverture
|
|
139
168
|
resetViewMode()
|
|
169
|
+
expect(currentViewMode.value).toBe('year')
|
|
140
170
|
|
|
141
|
-
//
|
|
171
|
+
// Vérifier que la navigation fonctionne encore
|
|
172
|
+
handleYearUpdate()
|
|
173
|
+
expect(currentViewMode.value).toBe('months')
|
|
174
|
+
|
|
175
|
+
handleMonthUpdate()
|
|
142
176
|
expect(currentViewMode.value).toBe('month')
|
|
143
177
|
})
|
|
144
178
|
|
|
145
|
-
it('
|
|
179
|
+
it('should prevent VDatePicker from overriding months mode', () => {
|
|
146
180
|
isBirthDate = true
|
|
147
181
|
|
|
148
|
-
const { currentViewMode,
|
|
182
|
+
const { currentViewMode, handleYearUpdate, handleViewModeUpdate } = useDatePickerViewMode(mockIsBirthDateGetter, mockSelectedDateGetter)
|
|
149
183
|
|
|
150
|
-
//
|
|
151
|
-
|
|
184
|
+
// Passer en mode months
|
|
185
|
+
handleYearUpdate()
|
|
186
|
+
expect(currentViewMode.value).toBe('months')
|
|
152
187
|
|
|
153
|
-
//
|
|
154
|
-
|
|
188
|
+
// VDatePicker essaie de forcer le mode 'month'
|
|
189
|
+
handleViewModeUpdate('month')
|
|
155
190
|
|
|
156
|
-
//
|
|
157
|
-
expect(currentViewMode.value).toBe('
|
|
191
|
+
// Le mode devrait rester 'months' (protection contre VDatePicker)
|
|
192
|
+
expect(currentViewMode.value).toBe('months')
|
|
158
193
|
})
|
|
159
194
|
})
|
|
160
195
|
})
|
|
@@ -38,10 +38,10 @@ describe('useMonthButtonCustomization', () => {
|
|
|
38
38
|
await nextTick()
|
|
39
39
|
|
|
40
40
|
const monthBtn = document.querySelector('.v-date-picker-controls__month-btn')!
|
|
41
|
-
expect(monthBtn.textContent).toContain('
|
|
41
|
+
expect(monthBtn.textContent).toContain('janv.')
|
|
42
42
|
})
|
|
43
43
|
|
|
44
|
-
it('personnalise correctement les noms de mois (février ->
|
|
44
|
+
it('personnalise correctement les noms de mois (février -> févr.)', async () => {
|
|
45
45
|
monthName.value = 'février'
|
|
46
46
|
const { customizeMonthButton } = useMonthButtonCustomization(
|
|
47
47
|
isPickerVisibleGetter,
|
|
@@ -52,7 +52,7 @@ describe('useMonthButtonCustomization', () => {
|
|
|
52
52
|
await nextTick()
|
|
53
53
|
|
|
54
54
|
const monthBtn = document.querySelector('.v-date-picker-controls__month-btn')!
|
|
55
|
-
expect(monthBtn.textContent).toContain('
|
|
55
|
+
expect(monthBtn.textContent).toContain('févr.')
|
|
56
56
|
})
|
|
57
57
|
|
|
58
58
|
it('capitalise le premier caractère si le mois n\'est pas reconnu', async () => {
|
|
@@ -66,7 +66,7 @@ describe('useMonthButtonCustomization', () => {
|
|
|
66
66
|
await nextTick()
|
|
67
67
|
|
|
68
68
|
const monthBtn = document.querySelector('.v-date-picker-controls__month-btn')!
|
|
69
|
-
expect(monthBtn.textContent).toContain('
|
|
69
|
+
expect(monthBtn.textContent).toContain('pluviose')
|
|
70
70
|
})
|
|
71
71
|
|
|
72
72
|
it('customise les boutons du mois et de l’année', async () => {
|
|
@@ -86,7 +86,7 @@ describe('useMonthButtonCustomization', () => {
|
|
|
86
86
|
const yearBtn = document.querySelector('.v-date-picker-controls__mode-btn')!
|
|
87
87
|
|
|
88
88
|
expect(monthBtn.innerHTML).toContain('<svg') // icône ajoutée
|
|
89
|
-
expect(monthBtn.textContent).toContain('
|
|
89
|
+
expect(monthBtn.textContent).toContain('janv.') // mois transformé
|
|
90
90
|
expect(monthButtonText.value).toBe('janvier 2023')
|
|
91
91
|
|
|
92
92
|
expect(yearBtn.innerHTML).toContain('2023')
|
|
@@ -109,7 +109,7 @@ describe('useMonthButtonCustomization', () => {
|
|
|
109
109
|
const monthBtn = document.querySelector('.v-date-picker-controls__month-btn')!
|
|
110
110
|
const yearBtn = document.querySelector('.v-date-picker-controls__mode-btn')!
|
|
111
111
|
|
|
112
|
-
expect(monthBtn.textContent).toContain('
|
|
112
|
+
expect(monthBtn.textContent).toContain('mars')
|
|
113
113
|
expect(yearBtn.textContent).toContain('2030')
|
|
114
114
|
})
|
|
115
115
|
|
|
@@ -15,25 +15,61 @@ export interface ViewModeReturn {
|
|
|
15
15
|
* Utilisé pour contrôler le comportement du CalendarMode, notamment pour les dates de naissance
|
|
16
16
|
*
|
|
17
17
|
* @param isBirthDateGetter - Une fonction qui retourne la valeur actuelle de isBirthDate
|
|
18
|
+
* @param selectedDateGetter - Une fonction qui retourne l'état de la date sélectionnée (null si aucune date)
|
|
18
19
|
*/
|
|
19
|
-
export function useDatePickerViewMode(
|
|
20
|
+
export function useDatePickerViewMode(
|
|
21
|
+
isBirthDateGetter: () => boolean,
|
|
22
|
+
selectedDateGetter: () => Date | (Date | null)[] | null,
|
|
23
|
+
): ViewModeReturn {
|
|
20
24
|
// Variable pour suivre le mode d'affichage actuel du CalendarMode
|
|
21
|
-
const currentViewMode = ref<ViewMode>(
|
|
25
|
+
const currentViewMode = ref<ViewMode>(
|
|
26
|
+
isBirthDateGetter() && !selectedDateGetter() ? 'year' : 'month',
|
|
27
|
+
)
|
|
22
28
|
|
|
23
29
|
// Mettre à jour le mode d'affichage quand isBirthDate change
|
|
24
30
|
watch(isBirthDateGetter, (newValue) => {
|
|
25
|
-
|
|
31
|
+
if (newValue && !selectedDateGetter()) {
|
|
32
|
+
// Mode birthDate et aucune date sélectionnée : commencer par year
|
|
33
|
+
currentViewMode.value = 'year'
|
|
34
|
+
}
|
|
35
|
+
else if (newValue && selectedDateGetter()) {
|
|
36
|
+
// Mode birthDate avec date sélectionnée : commencer par month
|
|
37
|
+
currentViewMode.value = 'month'
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Mode normal
|
|
41
|
+
currentViewMode.value = 'month'
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
// Mettre à jour le mode d'affichage quand la date sélectionnée change
|
|
46
|
+
watch(selectedDateGetter, (newValue) => {
|
|
47
|
+
if (isBirthDateGetter()) {
|
|
48
|
+
if (!newValue) {
|
|
49
|
+
// Aucune date sélectionnée en mode birthDate : commencer par year
|
|
50
|
+
currentViewMode.value = 'year'
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
// Date sélectionnée en mode birthDate : commencer par month
|
|
54
|
+
currentViewMode.value = 'month'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
26
57
|
})
|
|
27
58
|
|
|
28
59
|
// Fonction pour gérer le changement de mode d'affichage
|
|
29
60
|
const handleViewModeUpdate = (newMode: ViewMode) => {
|
|
61
|
+
// En mode birthDate, ne pas laisser VDatePicker écraser le mode 'months'
|
|
62
|
+
if (isBirthDateGetter() && currentViewMode.value === 'months' && newMode === 'month') {
|
|
63
|
+
return
|
|
64
|
+
}
|
|
65
|
+
|
|
30
66
|
currentViewMode.value = newMode
|
|
31
67
|
}
|
|
32
68
|
|
|
33
69
|
// Fonction pour gérer la sélection de l'année quand isBirthDate est true
|
|
34
70
|
const handleYearUpdate = () => {
|
|
35
71
|
if (isBirthDateGetter()) {
|
|
36
|
-
// Après la sélection de l'année, passer
|
|
72
|
+
// Après la sélection de l'année, passer au mode months pour la sélection du mois
|
|
37
73
|
currentViewMode.value = 'months'
|
|
38
74
|
}
|
|
39
75
|
}
|
|
@@ -41,14 +77,28 @@ export function useDatePickerViewMode(isBirthDateGetter: () => boolean): ViewMod
|
|
|
41
77
|
// Fonction pour gérer la sélection du mois quand isBirthDate est true
|
|
42
78
|
const handleMonthUpdate = () => {
|
|
43
79
|
if (isBirthDateGetter()) {
|
|
44
|
-
// Après la sélection du mois, passer automatiquement à la
|
|
45
|
-
currentViewMode.value =
|
|
80
|
+
// Après la sélection du mois, passer automatiquement à la vue calendrier mensuel
|
|
81
|
+
currentViewMode.value = 'month'
|
|
46
82
|
}
|
|
47
83
|
}
|
|
48
84
|
|
|
49
85
|
// Fonction pour réinitialiser le mode d'affichage (utile lors de la fermeture du CalendarMode)
|
|
50
86
|
const resetViewMode = () => {
|
|
51
|
-
|
|
87
|
+
if (isBirthDateGetter()) {
|
|
88
|
+
// En mode birthDate, la logique dépend de l'état de la date sélectionnée
|
|
89
|
+
if (!selectedDateGetter()) {
|
|
90
|
+
// Aucune date sélectionnée : commencer par year
|
|
91
|
+
currentViewMode.value = 'year'
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
// Date sélectionnée : commencer par month (calendrier) pour permettre la modification
|
|
95
|
+
currentViewMode.value = 'month'
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// Mode normal
|
|
100
|
+
currentViewMode.value = 'month'
|
|
101
|
+
}
|
|
52
102
|
}
|
|
53
103
|
|
|
54
104
|
return {
|
|
@@ -28,43 +28,43 @@ export function useMonthButtonCustomization(
|
|
|
28
28
|
switch (lowerMonth) {
|
|
29
29
|
case 'january':
|
|
30
30
|
case 'janvier':
|
|
31
|
-
return '
|
|
31
|
+
return 'janv.'
|
|
32
32
|
case 'february':
|
|
33
33
|
case 'février':
|
|
34
|
-
return '
|
|
34
|
+
return 'févr.'
|
|
35
35
|
case 'march':
|
|
36
36
|
case 'mars':
|
|
37
|
-
return '
|
|
37
|
+
return 'mars'
|
|
38
38
|
case 'april':
|
|
39
39
|
case 'avril':
|
|
40
|
-
return '
|
|
40
|
+
return 'avr.'
|
|
41
41
|
case 'may':
|
|
42
42
|
case 'mai':
|
|
43
|
-
return '
|
|
43
|
+
return 'mai'
|
|
44
44
|
case 'june':
|
|
45
45
|
case 'juin':
|
|
46
|
-
return '
|
|
46
|
+
return 'juin'
|
|
47
47
|
case 'july':
|
|
48
48
|
case 'juillet':
|
|
49
|
-
return '
|
|
49
|
+
return 'juil.'
|
|
50
50
|
case 'august':
|
|
51
51
|
case 'août':
|
|
52
|
-
return '
|
|
52
|
+
return 'août'
|
|
53
53
|
case 'september':
|
|
54
54
|
case 'septembre':
|
|
55
|
-
return '
|
|
55
|
+
return 'sept.'
|
|
56
56
|
case 'october':
|
|
57
57
|
case 'octobre':
|
|
58
|
-
return '
|
|
58
|
+
return 'oct.'
|
|
59
59
|
case 'november':
|
|
60
60
|
case 'novembre':
|
|
61
|
-
return '
|
|
61
|
+
return 'nov.'
|
|
62
62
|
case 'december':
|
|
63
63
|
case 'décembre':
|
|
64
|
-
return '
|
|
64
|
+
return 'déc.'
|
|
65
65
|
default:
|
|
66
66
|
// Si le mois n'est pas reconnu, retourner le mois avec la première lettre en majuscule
|
|
67
|
-
return monthName
|
|
67
|
+
return monthName
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -99,7 +99,7 @@ export function useMonthButtonCustomization(
|
|
|
99
99
|
<span class="v-btn__overlay"></span>
|
|
100
100
|
<span class="v-btn__underlay"></span>
|
|
101
101
|
<div class="v-btn__content" data-no-activator="" style="color: var(--v-theme-primary);">
|
|
102
|
-
<span style="color: var(--v-theme-primary);">${monthText
|
|
102
|
+
<span style="color: var(--v-theme-primary);">${monthText}</span>
|
|
103
103
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" class="ms-1" style="fill: var(--v-theme-primary);" aria-hidden="true"><path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" /></svg>
|
|
104
104
|
</div>
|
|
105
105
|
</button>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import { nextTick } from 'vue'
|
|
4
|
+
import { vuetify } from '../../../../tests/unit/setup'
|
|
5
|
+
import CalendarModeDatePicker from '@/components/DatePicker/CalendarMode/DatePicker.vue'
|
|
6
|
+
import ComplexDatePicker from '@/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Tests de régression légers pour la navigation année/mois dans les DatePickers
|
|
10
|
+
*
|
|
11
|
+
* Problème résolu : Handlers d'événements manquants et view mode non réinitialisé
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
describe('DatePicker Navigation Regression Tests', () => {
|
|
15
|
+
const baseConfig = {
|
|
16
|
+
global: {
|
|
17
|
+
plugins: [vuetify],
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
describe('CalendarMode DatePicker', () => {
|
|
22
|
+
it('should have correct event handlers for year and month updates', async () => {
|
|
23
|
+
const wrapper = mount(CalendarModeDatePicker, {
|
|
24
|
+
...baseConfig,
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: null,
|
|
27
|
+
label: 'Date Test',
|
|
28
|
+
isBirthDate: true, // Mode birthDate pour tester la navigation année/mois
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- any
|
|
33
|
+
const component = wrapper.vm as any
|
|
34
|
+
component.isDatePickerVisible = true
|
|
35
|
+
await nextTick()
|
|
36
|
+
|
|
37
|
+
// Vérifier que le VDatePicker est visible
|
|
38
|
+
const datePicker = wrapper.findComponent({ name: 'VDatePicker' })
|
|
39
|
+
expect(datePicker.exists()).toBe(true)
|
|
40
|
+
|
|
41
|
+
// Vérifier que les handlers d'événements sont correctement mappés
|
|
42
|
+
const datePickerProps = datePicker.props()
|
|
43
|
+
expect(datePickerProps).toBeDefined()
|
|
44
|
+
|
|
45
|
+
// Vérifier que le view mode est correctement initialisé
|
|
46
|
+
expect(datePickerProps.viewMode).toBe('year') // Mode birthDate commence par year
|
|
47
|
+
|
|
48
|
+
wrapper.unmount()
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
describe('ComplexDatePicker', () => {
|
|
53
|
+
it('should have correct navigation handlers', async () => {
|
|
54
|
+
const wrapper = mount(ComplexDatePicker, {
|
|
55
|
+
...baseConfig,
|
|
56
|
+
props: {
|
|
57
|
+
modelValue: null,
|
|
58
|
+
label: 'Date Test',
|
|
59
|
+
isBirthDate: true,
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- any
|
|
64
|
+
const component = wrapper.vm as any
|
|
65
|
+
|
|
66
|
+
// Vérifier que les handlers existent
|
|
67
|
+
expect(typeof component.handleYearUpdate).toBe('function')
|
|
68
|
+
expect(typeof component.handleMonthUpdate).toBe('function')
|
|
69
|
+
expect(typeof component.resetViewMode).toBe('function')
|
|
70
|
+
|
|
71
|
+
wrapper.unmount()
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
})
|