@cnamts/synapse 1.0.20 → 1.0.21

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.
Files changed (135) hide show
  1. package/dist/{DateFilter-XURUmpMl.js → DateFilter-uN8OURoP.js} +1 -1
  2. package/dist/{NumberFilter-BZc0O8wV.js → NumberFilter-sm1dQNQi.js} +1 -1
  3. package/dist/{PeriodFilter-ZNdXcl3p.js → PeriodFilter-Cklsxnh9.js} +1 -1
  4. package/dist/{SelectFilter-DshYU5OK.js → SelectFilter-CWefj27Z.js} +1 -1
  5. package/dist/{TextFilter-D_c5dRPl.js → TextFilter-Ddyj885L.js} +1 -1
  6. package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +160 -0
  7. package/dist/components/Customs/SyCheckBoxGroup/locales.d.ts +3 -0
  8. package/dist/components/Customs/SyCheckBoxGroup/types.d.ts +10 -0
  9. package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +1545 -2
  10. package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +1495 -2
  11. package/dist/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.d.ts +60 -0
  12. package/dist/components/ErrorPage/ErrorPage.d.ts +1 -12
  13. package/dist/components/ErrorPage/locales.d.ts +18 -3
  14. package/dist/components/FileUpload/FileUpload.d.ts +2 -0
  15. package/dist/components/MaintenancePage/locales.d.ts +18 -2
  16. package/dist/components/NotFoundPage/locales.d.ts +20 -4
  17. package/dist/components/StatusPage/StatusPage.d.ts +39 -0
  18. package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +13 -3
  19. package/dist/components/index.d.ts +3 -0
  20. package/dist/design-system-v3.js +126 -123
  21. package/dist/design-system-v3.umd.cjs +163 -163
  22. package/dist/{main-CuI6xaPq.js → main-CWniLr0s.js} +15191 -14668
  23. package/dist/style.css +1 -1
  24. package/dist/utils/theme/index.d.ts +6 -0
  25. package/package.json +7 -4
  26. package/src/components/ContextualMenu/ContextualMenu.stories.ts +0 -3
  27. package/src/components/ContextualMenu/accessibilite/Accessibility.mdx +67 -11
  28. package/src/components/CookieBanner/CookieBanner.stories.ts +11 -20
  29. package/src/components/CookieBanner/CookieBanner.vue +20 -5
  30. package/src/components/CookieBanner/accessibilite/Accessibility.mdx +67 -11
  31. package/src/components/CookieBanner/tests/CookieBanner.spec.ts +48 -4
  32. package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.mdx +32 -0
  33. package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.stories.ts +856 -0
  34. package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +334 -0
  35. package/src/components/Customs/SyCheckBoxGroup/accessibilite/Accessibility.mdx +243 -0
  36. package/src/components/Customs/SyCheckBoxGroup/locales.ts +3 -0
  37. package/src/components/Customs/SyCheckBoxGroup/tests/SyCheckBoxGroup.a11y.spec.ts +30 -0
  38. package/src/components/Customs/SyCheckBoxGroup/tests/SyCheckBoxGroup.spec.ts +152 -0
  39. package/src/components/Customs/SyCheckBoxGroup/types.ts +10 -0
  40. package/src/components/Customs/SyCheckbox/SyCheckbox.vue +16 -27
  41. package/src/components/Customs/SyCheckbox/accessibilite/Accessibility.mdx +1 -1
  42. package/src/components/Customs/SyForm/SyForm.a11y.spec.ts +1 -1
  43. package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +16 -43
  44. package/src/components/DatePicker/CalendarMode/DatePicker.vue +35 -11
  45. package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +43 -2
  46. package/src/components/DatePicker/DateTextInput/DateTextInput.vue +48 -21
  47. package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +98 -0
  48. package/src/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.mdx +83 -0
  49. package/src/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.stories.ts +502 -0
  50. package/src/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.vue +428 -0
  51. package/src/components/DeclarationAccessibilityPage/accessibilite/Accessibility.mdx +75 -0
  52. package/src/components/DeclarationAccessibilityPage/tests/DeclarationAccessibilityPage.a11y.spec.ts +53 -0
  53. package/src/components/DeclarationAccessibilityPage/tests/DeclarationAccessibilityPage.spec.ts +59 -0
  54. package/src/components/DiacriticPicker/DiacriticPicker.vue +20 -1
  55. package/src/components/ErrorPage/ErrorPage.mdx +6 -16
  56. package/src/components/ErrorPage/ErrorPage.stories.ts +16 -87
  57. package/src/components/ErrorPage/ErrorPage.vue +38 -125
  58. package/src/components/ErrorPage/accessibilite/Accessibility.mdx +68 -6
  59. package/src/components/ErrorPage/assets/error-ap.svg +1774 -0
  60. package/src/components/ErrorPage/locales.ts +21 -3
  61. package/src/components/ErrorPage/tests/ErrorPage.a11y.spec.ts +5 -13
  62. package/src/components/ErrorPage/tests/ErrorPage.spec.ts +2 -41
  63. package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +8 -266
  64. package/src/components/FileUpload/FileUpload.vue +5 -0
  65. package/src/components/FooterBar/FooterBar.stories.ts +18 -14
  66. package/src/components/FooterBar/defaultSocialMediaLinks.ts +6 -4
  67. package/src/components/MaintenancePage/MaintenancePage.mdx +1 -1
  68. package/src/components/MaintenancePage/MaintenancePage.vue +15 -7
  69. package/src/components/MaintenancePage/accessibilite/Accessibility.mdx +61 -6
  70. package/src/components/MaintenancePage/assets/maintenance-ap.svg +1718 -0
  71. package/src/components/MaintenancePage/locales.ts +24 -3
  72. package/src/components/MaintenancePage/tests/MaintenancePage.a11y.spec.ts +75 -3
  73. package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +42 -2
  74. package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +3 -2
  75. package/src/components/NotFoundPage/NotFoundPage.mdx +1 -1
  76. package/src/components/NotFoundPage/NotFoundPage.stories.ts +3 -3
  77. package/src/components/NotFoundPage/NotFoundPage.vue +16 -11
  78. package/src/components/NotFoundPage/accessibilite/Accessibility.mdx +78 -6
  79. package/src/components/NotFoundPage/assets/not-found-ap.svg +2061 -0
  80. package/src/components/NotFoundPage/locales.ts +24 -4
  81. package/src/components/NotFoundPage/tests/NotFoundPage.a11y.spec.ts +168 -4
  82. package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +100 -12
  83. package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +2 -2
  84. package/src/components/NotificationBar/NotificationBar.mdx +2 -2
  85. package/src/components/NotificationBar/accessibilite/Accessibility.mdx +68 -8
  86. package/src/components/PageContainer/tests/PageContainer.a11y.spec.ts +14 -7
  87. package/src/components/PhoneField/PhoneField.stories.ts +46 -38
  88. package/src/components/SocialMediaLinks/DefaultSocialMediaLinks.ts +6 -4
  89. package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +7 -5
  90. package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +17 -13
  91. package/src/components/SocialMediaLinks/SocialMediaLinks.vue +9 -1
  92. package/src/components/SocialMediaLinks/accessibilite/Accessibility.mdx +63 -11
  93. package/src/components/SocialMediaLinks/tests/DefaultSocialMediaLinks.spec.ts +5 -5
  94. package/src/components/SocialMediaLinks/tests/SocialMediaLinks.a11y.spec.ts +59 -0
  95. package/src/components/SocialMediaLinks/tests/SocialMediaLinks.spec.ts +9 -7
  96. package/src/components/StatusPage/StatusPage.mdx +22 -0
  97. package/src/components/StatusPage/StatusPage.stories.ts +193 -0
  98. package/src/components/StatusPage/StatusPage.vue +145 -0
  99. package/src/components/StatusPage/accessibilite/Accessibility.mdx +81 -0
  100. package/src/components/StatusPage/tests/StatusPage.a11y.spec.ts +29 -0
  101. package/src/components/StatusPage/tests/StatusPage.spec.ts +50 -0
  102. package/src/components/StatusPage/tests/__snapshots__/StatusPage.spec.ts.snap +270 -0
  103. package/src/components/TableToolbar/TableToolbar.stories.ts +6 -6
  104. package/src/components/TableToolbar/TableToolbar.vue +1 -1
  105. package/src/components/TableToolbar/tests/__snapshots__/TableToolbar.spec.ts.snap +0 -5
  106. package/src/components/UploadWorkflow/UploadWorkflow.mdx +11 -1
  107. package/src/components/UploadWorkflow/UploadWorkflow.stories.ts +107 -3
  108. package/src/components/UploadWorkflow/UploadWorkflow.vue +35 -24
  109. package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +48 -0
  110. package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +9 -5
  111. package/src/components/UploadWorkflow/useFileList.ts +7 -0
  112. package/src/components/index.ts +3 -0
  113. package/src/composables/rules/tests/useFieldValidation.spec.ts +39 -3
  114. package/src/composables/rules/useFieldValidation.ts +24 -9
  115. package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +7 -0
  116. package/src/utils/theme/index.ts +19 -0
  117. package/src/utils/theme/tests/useThemeLocales.spec.ts +245 -0
  118. package/dist/components/MaintenancePage/index.d.ts +0 -2
  119. package/src/components/Customs/SyPagination/tests/SyPagination.a11y.spec.ts +0 -27
  120. package/src/components/Customs/SyTabs/tests/SyTabs.a11y.spec.ts +0 -51
  121. package/src/components/DataListItem/tests/DataListItem.a11y.spec.ts +0 -31
  122. package/src/components/DatePicker/CalendarMode/tests/DatePicker.a11y.spec.ts +0 -27
  123. package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.a11y.spec.ts +0 -26
  124. package/src/components/DatePicker/DateTextInput/tests/DateTextInput.a11y.spec.ts +0 -27
  125. package/src/components/DownloadBtn/tests/DownloadBtn.a11y.spec.ts +0 -26
  126. package/src/components/ExternalLinks/tests/ExternalLinks.a11y.spec.ts +0 -39
  127. package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.a11y.spec.ts +0 -45
  128. package/src/components/HeaderToolbar/tests/HeaderToolbar.a11y.spec.ts +0 -25
  129. package/src/components/LunarCalendar/tests/LunarCalendar.a11y.spec.ts +0 -31
  130. package/src/components/MaintenancePage/index.ts +0 -3
  131. package/src/components/PageContainer/Accessibilite/AccessibilityGuide.mdx +0 -0
  132. package/src/components/PaginatedTable/tests/PaginatedTable.a11y.spec.ts +0 -43
  133. package/src/components/PhoneField/tests/PhoneField.a11y.spec.ts +0 -34
  134. /package/src/components/NotFoundPage/assets/{not-found.svg → not-found-cnam.svg} +0 -0
  135. /package/src/components/PageContainer/{Accessibilite → accessibilite}/Accessibility.mdx +0 -0
@@ -0,0 +1,245 @@
1
+ import { describe, it, expect, beforeEach, vi } from 'vitest'
2
+ import { useThemeLocales } from '../index'
3
+ import { useTheme } from 'vuetify'
4
+ import { nextTick, ref } from 'vue'
5
+ import type { Mock } from 'vitest'
6
+
7
+ // Mock Vuetify
8
+ vi.mock('vuetify', () => ({
9
+ useTheme: vi.fn(),
10
+ }))
11
+
12
+ describe('useThemeLocales', () => {
13
+ let mockTheme: { name: ReturnType<typeof ref<string>> }
14
+
15
+ beforeEach(() => {
16
+ // Reset mock before each test
17
+ vi.clearAllMocks()
18
+
19
+ // Setup default mock theme with reactive ref
20
+ mockTheme = {
21
+ name: ref('default'),
22
+ }
23
+ ;(useTheme as Mock).mockReturnValue(mockTheme)
24
+ })
25
+
26
+ it('should return themeLocales computed property', () => {
27
+ const locales = {
28
+ default: { title: 'Default Title', pageTitle: 'Default', message: 'msg', code: '500' },
29
+ }
30
+
31
+ const { themeLocales } = useThemeLocales(locales)
32
+
33
+ expect(themeLocales).toBeDefined()
34
+ expect(themeLocales.value).toEqual({ title: 'Default Title', pageTitle: 'Default', message: 'msg', code: '500' })
35
+ })
36
+
37
+ it('should return default locale when theme name is not found', () => {
38
+ const locales = {
39
+ default: { title: 'Default Title', message: 'Default Message', pageTitle: 'Default', code: '500' },
40
+ cnam: { title: 'CNAM Title', message: 'CNAM Message', pageTitle: 'CNAM', code: '500' },
41
+ }
42
+
43
+ mockTheme.name.value = 'unknown'
44
+
45
+ const { themeLocales } = useThemeLocales(locales)
46
+
47
+ expect(themeLocales.value).toEqual({
48
+ title: 'Default Title',
49
+ message: 'Default Message',
50
+ pageTitle: 'Default',
51
+ code: '500',
52
+ })
53
+ })
54
+
55
+ it('should return locale for cnam theme', () => {
56
+ const locales = {
57
+ default: { title: 'Default Title', pageTitle: 'Default', message: 'msg', code: '500' },
58
+ cnam: { title: 'CNAM Title', message: 'CNAM Message', pageTitle: 'CNAM', code: '500' },
59
+ }
60
+
61
+ mockTheme.name.value = 'cnam'
62
+
63
+ const { themeLocales } = useThemeLocales(locales)
64
+
65
+ expect(themeLocales.value).toEqual({
66
+ title: 'CNAM Title',
67
+ message: 'CNAM Message',
68
+ pageTitle: 'CNAM',
69
+ code: '500',
70
+ })
71
+ })
72
+
73
+ it('should return locale for ap theme', () => {
74
+ const locales = {
75
+ default: { title: 'Default Title', pageTitle: 'Default', message: 'msg', code: '500' },
76
+ ap: { title: 'AP Title', message: 'AP Message', pageTitle: 'AP', code: '500' },
77
+ }
78
+
79
+ mockTheme.name.value = 'ap'
80
+
81
+ const { themeLocales } = useThemeLocales(locales)
82
+
83
+ expect(themeLocales.value).toEqual({
84
+ title: 'AP Title',
85
+ message: 'AP Message',
86
+ pageTitle: 'AP',
87
+ code: '500',
88
+ })
89
+ })
90
+
91
+ it('should return locale for ap2026 theme', () => {
92
+ const locales = {
93
+ default: { title: 'Default Title', pageTitle: 'Default', message: 'msg', code: '500' },
94
+ ap2026: { title: 'AP 2026 Title', message: 'AP 2026 Message', pageTitle: 'AP2026', code: '500' },
95
+ }
96
+
97
+ mockTheme.name.value = 'ap2026'
98
+
99
+ const { themeLocales } = useThemeLocales(locales)
100
+
101
+ expect(themeLocales.value).toEqual({
102
+ title: 'AP 2026 Title',
103
+ message: 'AP 2026 Message',
104
+ pageTitle: 'AP2026',
105
+ code: '500',
106
+ })
107
+ })
108
+
109
+ it('should update themeLocales when theme changes', async () => {
110
+ const locales = {
111
+ default: { title: 'Default Title', pageTitle: 'Default', message: 'msg', code: '500' },
112
+ cnam: { title: 'CNAM Title', pageTitle: 'CNAM', message: 'msg', code: '500' },
113
+ ap: { title: 'AP Title', pageTitle: 'AP', message: 'msg', code: '500' },
114
+ }
115
+
116
+ // Initial theme
117
+ mockTheme.name.value = 'cnam'
118
+ const { themeLocales } = useThemeLocales(locales)
119
+ expect(themeLocales.value.title).toBe('CNAM Title')
120
+
121
+ // Change theme
122
+ mockTheme.name.value = 'ap'
123
+ await nextTick()
124
+ expect(themeLocales.value.title).toBe('AP Title')
125
+
126
+ // Change to default
127
+ mockTheme.name.value = 'default'
128
+ await nextTick()
129
+ expect(themeLocales.value.title).toBe('Default Title')
130
+ })
131
+
132
+ it('should handle complex locale objects', () => {
133
+ const locales = {
134
+ default: {
135
+ pageTitle: 'Error',
136
+ message: 'An error occurred',
137
+ code: '500',
138
+ src: undefined,
139
+ },
140
+ cnam: {
141
+ pageTitle: 'Error CNAM',
142
+ message: 'An error occurred at CNAM',
143
+ code: '500',
144
+ src: undefined,
145
+ },
146
+ ap: {
147
+ pageTitle: 'Error AP',
148
+ message: 'An error occurred at AP',
149
+ code: '500',
150
+ src: 'image-ap.svg',
151
+ },
152
+ }
153
+
154
+ mockTheme.name.value = 'ap'
155
+
156
+ const { themeLocales } = useThemeLocales(locales)
157
+
158
+ expect(themeLocales.value).toEqual({
159
+ pageTitle: 'Error AP',
160
+ message: 'An error occurred at AP',
161
+ code: '500',
162
+ src: 'image-ap.svg',
163
+ })
164
+ })
165
+
166
+ it('should maintain reactivity across multiple instances', async () => {
167
+ const locales = {
168
+ default: { title: 'Default', pageTitle: 'Default', message: 'msg', code: '500' },
169
+ cnam: { title: 'CNAM', pageTitle: 'CNAM', message: 'msg', code: '500' },
170
+ }
171
+
172
+ const { themeLocales: locales1 } = useThemeLocales(locales)
173
+ const { themeLocales: locales2 } = useThemeLocales(locales)
174
+
175
+ mockTheme.name.value = 'cnam'
176
+ await nextTick()
177
+
178
+ expect(locales1.value.title).toBe('CNAM')
179
+ expect(locales2.value.title).toBe('CNAM')
180
+ })
181
+
182
+ it('should handle locale with null or undefined values', () => {
183
+ const locales = {
184
+ default: { title: 'Default', icon: null, description: undefined, pageTitle: 'Default', message: 'msg', code: '500' },
185
+ cnam: { title: 'CNAM', icon: null, description: undefined, pageTitle: 'CNAM', message: 'msg', code: '500' },
186
+ }
187
+
188
+ mockTheme.name.value = 'cnam'
189
+
190
+ const { themeLocales } = useThemeLocales(locales)
191
+
192
+ expect(themeLocales.value.title).toBe('CNAM')
193
+ expect(themeLocales.value.icon).toBeNull()
194
+ })
195
+
196
+ it('should work with generic type inference', () => {
197
+ const locales = {
198
+ default: { title: 'Default', message: 'Default message', pageTitle: 'Default', code: '500' },
199
+ cnam: {
200
+ title: 'CNAM',
201
+ message: 'CNAM message',
202
+ code: '500',
203
+ pageTitle: 'CNAM',
204
+ },
205
+ }
206
+
207
+ mockTheme.name.value = 'cnam'
208
+
209
+ const { themeLocales } = useThemeLocales(locales)
210
+
211
+ expect(themeLocales.value.title).toBe('CNAM')
212
+ expect(themeLocales.value.message).toBe('CNAM message')
213
+ })
214
+
215
+ it('should prefer theme locale over default when available', () => {
216
+ const locales = {
217
+ default: { title: 'Default Title', message: 'Default Message', pageTitle: 'Default', code: '500' },
218
+ custom: { title: 'Custom Title', message: 'Custom Message', pageTitle: 'Custom', code: '500' },
219
+ }
220
+
221
+ mockTheme.name.value = 'custom'
222
+
223
+ const { themeLocales } = useThemeLocales(locales)
224
+
225
+ expect(themeLocales.value.title).toBe('Custom Title')
226
+ expect(themeLocales.value.message).toBe('Custom Message')
227
+ })
228
+
229
+ it('should fallback to default when accessing non-existent theme', () => {
230
+ const locales = {
231
+ default: { title: 'Default', message: 'Default message', pageTitle: 'Default', code: '500' },
232
+ }
233
+
234
+ mockTheme.name.value = 'nonexistent'
235
+
236
+ const { themeLocales } = useThemeLocales(locales)
237
+
238
+ expect(themeLocales.value).toEqual({
239
+ title: 'Default',
240
+ message: 'Default message',
241
+ pageTitle: 'Default',
242
+ code: '500',
243
+ })
244
+ })
245
+ })
@@ -1,2 +0,0 @@
1
- import { default as MaintenancePage } from './MaintenancePage';
2
- export default MaintenancePage;
@@ -1,27 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import SyPagination from '../SyPagination.vue'
8
-
9
- // Scénario d’accessibilité : pagination avec libellé, aria-controls et page active.
10
-
11
- describe('SyPagination – accessibility (axe)', () => {
12
- it('has no obvious axe violations with labelled navigation and active page', async () => {
13
- const wrapper = mount(SyPagination, {
14
- props: {
15
- modelValue: 3,
16
- pages: 10,
17
- label: 'Pagination des résultats',
18
- ariaControls: 'liste-resultats',
19
- },
20
- })
21
-
22
- const results = await axe(wrapper.element as HTMLElement)
23
- assertNoA11yViolations(results, 'SyPagination – labelled navigation', {
24
- ignoreRules: ['region'],
25
- })
26
- })
27
- })
@@ -1,51 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it, vi } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import SyTabs from '../SyTabs.vue'
8
-
9
- // Stub RouterLink pour éviter de dépendre du routeur réel
10
- const RouterLink = {
11
- name: 'RouterLink',
12
- props: ['to'],
13
- template: '<a :href="to"><slot /></a>',
14
- }
15
-
16
- const testItems = [
17
- { label: 'Tab 1', value: 'tab1', content: 'Contenu du Tab 1' },
18
- { label: 'Tab 2', value: 'tab2', content: 'Contenu du Tab 2' },
19
- { label: 'Tab 3', value: 'tab3', content: 'Contenu du Tab 3' },
20
- ]
21
-
22
- // Scénario d’accessibilité : groupe d’onglets avec trois panneaux.
23
-
24
- describe('SyTabs – accessibility (axe)', () => {
25
- it('has no obvious axe violations with three tabs and panels', async () => {
26
- const wrapper = mount(SyTabs, {
27
- props: {
28
- items: testItems,
29
- },
30
- global: {
31
- components: {
32
- RouterLink,
33
- },
34
- mocks: {
35
- $router: {
36
- push: vi.fn(),
37
- replace: vi.fn(),
38
- },
39
- },
40
- },
41
- attachTo: document.body,
42
- })
43
-
44
- const results = await axe(wrapper.element as HTMLElement)
45
- assertNoA11yViolations(results, 'SyTabs – default configuration', {
46
- ignoreRules: ['region'],
47
- })
48
-
49
- wrapper.unmount()
50
- })
51
- })
@@ -1,31 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import DataListItem from '../DataListItem.vue'
8
-
9
- const defaultProps = {
10
- label: 'Adresse e-mail',
11
- value: 'sample@example.com',
12
- action: 'Modifier',
13
- chip: true,
14
- row: false,
15
- }
16
-
17
- describe('DataListItem – accessibility (axe)', () => {
18
- it('has no obvious axe violations with chip, icon slot and action', async () => {
19
- const wrapper = mount(DataListItem, {
20
- props: defaultProps,
21
- slots: {
22
- icon: '<span aria-hidden="true" class="fake-icon" />',
23
- },
24
- })
25
-
26
- const results = await axe(wrapper.element as HTMLElement)
27
- assertNoA11yViolations(results, 'DataListItem – chip and action', {
28
- ignoreRules: ['region'],
29
- })
30
- })
31
- })
@@ -1,27 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import DatePicker from '../DatePicker.vue'
8
-
9
- // Scénario d’accessibilité : champ de date en mode calendrier,
10
- // avec label et champ requis, calendrier fermé (état par défaut).
11
-
12
- describe('DatePicker (CalendarMode) – accessibility (axe)', () => {
13
- it('has no obvious axe violations in default state', async () => {
14
- const wrapper = mount(DatePicker, {
15
- props: {
16
- label: 'Date de naissance',
17
- format: 'DD/MM/YYYY',
18
- required: true,
19
- },
20
- })
21
-
22
- const results = await axe(wrapper.element as HTMLElement)
23
- assertNoA11yViolations(results, 'DatePicker (CalendarMode) – default state', {
24
- ignoreRules: ['region'],
25
- })
26
- })
27
- })
@@ -1,26 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import ComplexDatePicker from '../ComplexDatePicker.vue'
8
-
9
- // Scénario d’accessibilité : sélecteur de date combiné (champ + calendrier),
10
- // en mode simple, avec label et format jour/mois/année.
11
-
12
- describe('ComplexDatePicker – accessibility (axe)', () => {
13
- it('has no obvious axe violations in default calendar mode', async () => {
14
- const wrapper = mount(ComplexDatePicker, {
15
- props: {
16
- label: 'Date',
17
- format: 'DD/MM/YYYY',
18
- },
19
- })
20
-
21
- const results = await axe(wrapper.element as HTMLElement)
22
- assertNoA11yViolations(results, 'ComplexDatePicker – default calendar mode', {
23
- ignoreRules: ['region'],
24
- })
25
- })
26
- })
@@ -1,27 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import DateTextInput from '../DateTextInput.vue'
8
-
9
- // Scénario d’accessibilité : champ texte de date seul, requis,
10
- // avec format jour/mois/année.
11
-
12
- describe('DateTextInput – accessibility (axe)', () => {
13
- it('has no obvious axe violations for a required single date field', async () => {
14
- const wrapper = mount(DateTextInput, {
15
- props: {
16
- label: 'Date',
17
- format: 'DD/MM/YYYY',
18
- required: true,
19
- },
20
- })
21
-
22
- const results = await axe(wrapper.element as HTMLElement)
23
- assertNoA11yViolations(results, 'DateTextInput – required single date', {
24
- ignoreRules: ['region'],
25
- })
26
- })
27
- })
@@ -1,26 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import DownloadBtn from '../DownloadBtn.vue'
8
- import { filePromise } from './data/filePromise'
9
-
10
- // Scénario d’accessibilité : bouton de téléchargement prêt à l’emploi
11
- // avec icône, texte par défaut et état initial idle.
12
-
13
- describe('DownloadBtn – accessibility (axe)', () => {
14
- it('has no obvious axe violations in default state', async () => {
15
- const wrapper = mount(DownloadBtn, {
16
- props: {
17
- filePromise,
18
- },
19
- })
20
-
21
- const results = await axe(wrapper.element as HTMLElement)
22
- assertNoA11yViolations(results, 'DownloadBtn – default state', {
23
- ignoreRules: ['region'],
24
- })
25
- })
26
- })
@@ -1,39 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import ExternalLinks from '../ExternalLinks.vue'
8
-
9
- const items = [
10
- { text: 'ameli.fr', href: 'https://www.ameli.fr' },
11
- { text: 'Service-public.fr', href: 'https://www.service-public.fr' },
12
- ]
13
-
14
- // Scénario d’accessibilité : bouton externe fixé en bas à droite,
15
- // menu ouvert avec une liste de liens.
16
-
17
- describe('ExternalLinks – accessibility (axe)', () => {
18
- it('has no obvious axe violations with menu open and items', async () => {
19
- const wrapper = mount(ExternalLinks, {
20
- props: {
21
- position: 'bottom right',
22
- items,
23
- fixed: true,
24
- },
25
- attachTo: document.body,
26
- })
27
-
28
- const button = wrapper.find('button')
29
- await button.trigger('click')
30
- await wrapper.vm.$nextTick()
31
-
32
- const results = await axe(document.body)
33
- assertNoA11yViolations(results, 'ExternalLinks – menu open with items', {
34
- ignoreRules: ['region'],
35
- })
36
-
37
- wrapper.unmount()
38
- })
39
- })
@@ -1,45 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it, vi } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import HeaderNavbar from '../HeaderNavigationBar.vue'
8
-
9
- // Scénario d’accessibilité : barre de navigation avec onglets horizontaux en mode desktop.
10
-
11
- vi.mock('@/utils/functions/throttleDisplayFn/throttleDisplayFn.ts', () => ({
12
- default: (fn: (...args: unknown[]) => void) => fn,
13
- }))
14
-
15
- describe('HeaderNavigationBar – accessibility (axe)', () => {
16
- it('has no obvious axe violations in desktop horizontal mode', async () => {
17
- // @ts-expect-error - Property 'happyDOM' does not exist on type 'Window & typeof globalThis'.
18
- window.window.happyDOM.setInnerWidth(1200)
19
-
20
- const wrapper = mount(HeaderNavbar, {
21
- global: {
22
- stubs: {
23
- Teleport: true,
24
- RouterLink: true,
25
- },
26
- },
27
- props: {
28
- items: [
29
- { label: 'Accueil', to: '/' },
30
- { label: 'À propos', to: '/about' },
31
- ],
32
- },
33
- attachTo: document.body,
34
- })
35
-
36
- await wrapper.vm.$nextTick()
37
-
38
- const results = await axe(wrapper.element as HTMLElement)
39
- assertNoA11yViolations(results, 'HeaderNavigationBar – desktop horizontal', {
40
- ignoreRules: ['region'],
41
- })
42
-
43
- wrapper.unmount()
44
- })
45
- })
@@ -1,25 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import HeaderToolbar from '../HeaderToolbar.vue'
8
-
9
- // Scénario d’accessibilité : barre d’outils d’en-tête avec menus gauche/droite
10
- // rendus en mode bureau.
11
-
12
- describe('HeaderToolbar – accessibility (axe)', () => {
13
- it('has no obvious axe violations with default desktop menus', async () => {
14
- const wrapper = mount(HeaderToolbar, {
15
- attachTo: document.body,
16
- })
17
-
18
- const results = await axe(wrapper.element as HTMLElement)
19
- assertNoA11yViolations(results, 'HeaderToolbar – default desktop menus', {
20
- ignoreRules: ['region'],
21
- })
22
-
23
- wrapper.unmount()
24
- })
25
- })
@@ -1,31 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import LunarCalendar from '../LunarCalendar.vue'
8
-
9
- // Scénario d’accessibilité : champ de date lunaire avec label requis et valeur renseignée.
10
-
11
- describe('LunarCalendar – accessibility (axe)', () => {
12
- it('has no obvious axe violations with labeled required field', async () => {
13
- const wrapper = mount(LunarCalendar, {
14
- props: {
15
- label: 'Date de naissance',
16
- modelValue: '10/19/1995',
17
- required: true,
18
- minYear: 1900,
19
- maxYear: 2030,
20
- },
21
- attachTo: document.body,
22
- })
23
-
24
- const results = await axe(wrapper.element as HTMLElement)
25
- assertNoA11yViolations(results, 'LunarCalendar – labeled required field', {
26
- ignoreRules: ['region'],
27
- })
28
-
29
- wrapper.unmount()
30
- })
31
- })
@@ -1,3 +0,0 @@
1
- import MaintenancePage from './MaintenancePage.vue'
2
-
3
- export default MaintenancePage
@@ -1,43 +0,0 @@
1
- // @vitest-environment jsdom
2
-
3
- import { describe, it } from 'vitest'
4
- import { mount } from '@vue/test-utils'
5
- import { axe } from 'vitest-axe'
6
- import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
7
- import PaginatedTable from '../PaginatedTable.vue'
8
- import type { DataOptions } from '@/components/PaginatedTable/types'
9
-
10
- const fakeItems = [
11
- { id: 1, name: 'John Doe', age: 25 },
12
- { id: 2, name: 'Jane Doe', age: 30 },
13
- { id: 3, name: 'John Smith', age: 35 },
14
- ] as const
15
-
16
- const headers = [
17
- { title: 'ID', key: 'id' },
18
- { title: 'Name', key: 'name' },
19
- { title: 'Age', key: 'age' },
20
- ]
21
-
22
- // Scénario d’accessibilité : tableau paginé en mode local avec légende cachée.
23
-
24
- describe('PaginatedTable – accessibility (axe)', () => {
25
- it('has no obvious axe violations in local mode with caption', async () => {
26
- const wrapper = mount(PaginatedTable, {
27
- props: {
28
- options: {} as DataOptions,
29
- items: fakeItems,
30
- headers,
31
- caption: 'Liste des utilisateurs',
32
- },
33
- attachTo: document.body,
34
- })
35
-
36
- const results = await axe(wrapper.element as HTMLElement)
37
- assertNoA11yViolations(results, 'PaginatedTable – local mode with caption', {
38
- ignoreRules: ['region'],
39
- })
40
-
41
- wrapper.unmount()
42
- })
43
- })