@zap-wunschlachen/wl-shared-components 1.0.35 → 1.0.38

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 (30) hide show
  1. package/App.vue +2 -7
  2. package/package.json +1 -1
  3. package/src/components/Audio/Waveform.vue +1 -0
  4. package/src/components/Button/Button.vue +39 -1
  5. package/src/components/CheckBox/CheckBox.css +29 -0
  6. package/src/components/CheckBox/Checkbox.vue +10 -2
  7. package/src/components/Dialog/Dialog.vue +14 -5
  8. package/src/components/Input/Input.vue +8 -2
  9. package/src/components/Loader/Loader.css +20 -0
  10. package/src/components/Loader/Loader.vue +1 -0
  11. package/src/components/OtpInput/OtpInput.vue +1 -1
  12. package/src/components/Select/Select.vue +1 -0
  13. package/src/components/StagingBanner/StagingBanner.css +19 -0
  14. package/src/components/StagingBanner/StagingBanner.vue +82 -0
  15. package/src/components/accessibility.css +218 -0
  16. package/src/components/index.ts +1 -0
  17. package/tests/unit/accessibility/component-a11y.spec.ts +469 -0
  18. package/tests/unit/components/Accordion/AccordionGroup.spec.ts +228 -0
  19. package/tests/unit/components/Accordion/AccordionItem.spec.ts +292 -0
  20. package/tests/unit/components/Appointment/AnamneseNotification.spec.ts +176 -0
  21. package/tests/unit/components/Background/Background.spec.ts +177 -0
  22. package/tests/unit/components/ErrorPage/ErrorPage.spec.ts +313 -0
  23. package/tests/unit/components/ErrorPage/ErrorPageLogo.spec.ts +153 -0
  24. package/tests/unit/components/Icons/AdvanceAppointments.spec.ts +61 -0
  25. package/tests/unit/components/Icons/Logo.spec.ts +228 -0
  26. package/tests/unit/components/Icons/MiniLogo.spec.ts +38 -0
  27. package/tests/unit/components/Icons/SolidArrowRight.spec.ts +49 -0
  28. package/tests/unit/components/Loader/Loader.spec.ts +197 -0
  29. package/tests/unit/components/MaintenanceBanner/MaintenanceBanner.spec.ts +302 -0
  30. package/tests/unit/utils/accessibility.spec.ts +318 -0
@@ -0,0 +1,302 @@
1
+ import { describe, it, expect, vi } from 'vitest';
2
+ import { mount } from '@vue/test-utils';
3
+ import MaintenanceBanner from '@components/MaintenanceBanner/MaintenanceBanner.vue';
4
+
5
+ // Mock siteColors
6
+ vi.mock('@/utils/index', () => ({
7
+ siteColors: {
8
+ domain: 'domain-dental',
9
+ font_color_code: '#172774',
10
+ font_color_title_code: '#172774'
11
+ }
12
+ }));
13
+
14
+ // Mock child components
15
+ vi.mock('@components/Background/Background.vue', () => ({
16
+ default: {
17
+ name: 'Background',
18
+ template: '<div class="background"><slot /></div>'
19
+ }
20
+ }));
21
+
22
+ vi.mock('@components/Icons/Logo.vue', () => ({
23
+ default: {
24
+ name: 'Logo',
25
+ template: '<div class="logo"></div>',
26
+ props: ['width', 'height']
27
+ }
28
+ }));
29
+
30
+ vi.mock('@components/MaintenanceBanner/MaintenanceIllustration.vue', () => ({
31
+ default: {
32
+ name: 'MaintenanceIllustration',
33
+ template: '<div class="maintenance-illustration"></div>'
34
+ }
35
+ }));
36
+
37
+ vi.mock('@components/Button/Button.vue', () => ({
38
+ default: {
39
+ name: 'Button',
40
+ template: '<button class="wl-button" @click="$emit(\'click\')">{{ label }}</button>',
41
+ props: ['variant', 'color', 'label'],
42
+ emits: ['click']
43
+ }
44
+ }));
45
+
46
+ // Mock HeroIcons
47
+ vi.mock('@heroicons/vue/24/outline', () => ({
48
+ PhoneIcon: {
49
+ name: 'PhoneIcon',
50
+ template: '<svg class="phone-icon"></svg>'
51
+ },
52
+ EnvelopeIcon: {
53
+ name: 'EnvelopeIcon',
54
+ template: '<svg class="envelope-icon"></svg>'
55
+ }
56
+ }));
57
+
58
+ describe('MaintenanceBanner', () => {
59
+ describe('Default Behavior', () => {
60
+ it('renders maintenance banner', () => {
61
+ const wrapper = mount(MaintenanceBanner);
62
+ expect(wrapper.find('.maintenance-banner__content').exists()).toBe(true);
63
+ });
64
+
65
+ it('renders default title', () => {
66
+ const wrapper = mount(MaintenanceBanner);
67
+ expect(wrapper.find('h1').text()).toBe('Wir polieren gerade nach');
68
+ });
69
+
70
+ it('renders default description', () => {
71
+ const wrapper = mount(MaintenanceBanner);
72
+ const description = wrapper.find('.maintenance-banner__description');
73
+ expect(description.text()).toContain('Unsere Webseite befindet sich aktuell in Wartung');
74
+ });
75
+
76
+ it('renders Logo component', () => {
77
+ const wrapper = mount(MaintenanceBanner);
78
+ expect(wrapper.find('.logo').exists()).toBe(true);
79
+ });
80
+
81
+ it('renders call to action button', () => {
82
+ const wrapper = mount(MaintenanceBanner);
83
+ const button = wrapper.find('.wl-button');
84
+ expect(button.exists()).toBe(true);
85
+ expect(button.text()).toBe('Jetzt anrufen');
86
+ });
87
+ });
88
+
89
+ describe('Props', () => {
90
+ it('accepts custom title', () => {
91
+ const wrapper = mount(MaintenanceBanner, {
92
+ props: { title: 'Custom Title' }
93
+ });
94
+
95
+ expect(wrapper.find('h1').text()).toBe('Custom Title');
96
+ });
97
+
98
+ it('accepts custom description', () => {
99
+ const wrapper = mount(MaintenanceBanner, {
100
+ props: { description: 'Custom description text' }
101
+ });
102
+
103
+ expect(wrapper.find('.maintenance-banner__description').text()).toContain('Custom description text');
104
+ });
105
+
106
+ it('accepts custom phone number', () => {
107
+ const wrapper = mount(MaintenanceBanner, {
108
+ props: { phone: '+49123456789' }
109
+ });
110
+
111
+ expect(wrapper.text()).toContain('+49123456789');
112
+ });
113
+
114
+ it('accepts custom email', () => {
115
+ const wrapper = mount(MaintenanceBanner, {
116
+ props: { email: 'test@example.com' }
117
+ });
118
+
119
+ expect(wrapper.text()).toContain('test@example.com');
120
+ });
121
+
122
+ it('accepts custom button text', () => {
123
+ const wrapper = mount(MaintenanceBanner, {
124
+ props: { buttonText: 'Contact Us' }
125
+ });
126
+
127
+ expect(wrapper.find('.wl-button').text()).toBe('Contact Us');
128
+ });
129
+ });
130
+
131
+ describe('Contact Information', () => {
132
+ it('displays phone icon', () => {
133
+ const wrapper = mount(MaintenanceBanner);
134
+ expect(wrapper.find('.phone-icon').exists()).toBe(true);
135
+ });
136
+
137
+ it('displays envelope icon', () => {
138
+ const wrapper = mount(MaintenanceBanner);
139
+ expect(wrapper.find('.envelope-icon').exists()).toBe(true);
140
+ });
141
+
142
+ it('renders default dental phone number', () => {
143
+ const wrapper = mount(MaintenanceBanner);
144
+ expect(wrapper.text()).toContain('+49304952010');
145
+ });
146
+
147
+ it('renders default dental email', () => {
148
+ const wrapper = mount(MaintenanceBanner);
149
+ expect(wrapper.text()).toContain('info@wunschlachen.de');
150
+ });
151
+ });
152
+
153
+ describe('Domain-specific Rendering', () => {
154
+ it('renders illustration for dental domain', () => {
155
+ const wrapper = mount(MaintenanceBanner);
156
+ expect(wrapper.find('.maintenance-illustration').exists()).toBe(true);
157
+ });
158
+ });
159
+
160
+ describe('Accessibility', () => {
161
+ it('has h1 heading for main title', () => {
162
+ const wrapper = mount(MaintenanceBanner);
163
+ const h1 = wrapper.find('h1');
164
+ expect(h1.exists()).toBe(true);
165
+ expect(h1.text()).toBeTruthy();
166
+ });
167
+
168
+ it('has proper semantic structure', () => {
169
+ const wrapper = mount(MaintenanceBanner);
170
+
171
+ // Should have heading
172
+ expect(wrapper.find('h1').exists()).toBe(true);
173
+
174
+ // Should have contact information
175
+ expect(wrapper.find('.maintenance-banner__contact').exists()).toBe(true);
176
+ });
177
+
178
+ it('provides meaningful contact information', () => {
179
+ const wrapper = mount(MaintenanceBanner, {
180
+ props: {
181
+ phone: '+49123456789',
182
+ email: 'contact@example.com'
183
+ }
184
+ });
185
+
186
+ // Phone and email should be visible
187
+ expect(wrapper.text()).toContain('+49123456789');
188
+ expect(wrapper.text()).toContain('contact@example.com');
189
+ });
190
+
191
+ it('has accessible button', () => {
192
+ const wrapper = mount(MaintenanceBanner);
193
+ const button = wrapper.find('button');
194
+ expect(button.exists()).toBe(true);
195
+ expect(button.text()).toBeTruthy();
196
+ });
197
+
198
+ it('has proper visual hierarchy', () => {
199
+ const wrapper = mount(MaintenanceBanner);
200
+
201
+ // Title should be in h1
202
+ const h1 = wrapper.find('h1');
203
+ expect(h1.exists()).toBe(true);
204
+
205
+ // Description should be in paragraph
206
+ const description = wrapper.find('.maintenance-banner__description');
207
+ expect(description.exists()).toBe(true);
208
+ });
209
+ });
210
+
211
+ describe('User Interaction', () => {
212
+ it('button click triggers phone call', async () => {
213
+ const originalLocation = window.location;
214
+ delete (window as any).location;
215
+ window.location = { href: '' } as Location;
216
+
217
+ try {
218
+ const wrapper = mount(MaintenanceBanner, {
219
+ props: { phone: '+49 123 456 789' }
220
+ });
221
+
222
+ const button = wrapper.find('button');
223
+ await button.trigger('click');
224
+
225
+ expect(window.location.href).toBe('tel:+49123456789');
226
+ } finally {
227
+ window.location = originalLocation;
228
+ }
229
+ });
230
+ });
231
+
232
+ describe('Description HTML Escaping', () => {
233
+ it('escapes HTML in description to prevent XSS', () => {
234
+ const wrapper = mount(MaintenanceBanner, {
235
+ props: {
236
+ description: '<script>alert("XSS")</script>'
237
+ }
238
+ });
239
+
240
+ const html = wrapper.find('.maintenance-banner__description').html();
241
+ expect(html).not.toContain('<script>');
242
+ expect(html).toContain('&lt;script&gt;');
243
+ });
244
+
245
+ it('converts newlines to br tags', () => {
246
+ const wrapper = mount(MaintenanceBanner, {
247
+ props: {
248
+ description: 'Line 1\nLine 2'
249
+ }
250
+ });
251
+
252
+ const html = wrapper.find('.maintenance-banner__description').html();
253
+ expect(html).toContain('<br');
254
+ });
255
+ });
256
+
257
+ describe('Visual Structure', () => {
258
+ it('has proper class structure', () => {
259
+ const wrapper = mount(MaintenanceBanner);
260
+
261
+ expect(wrapper.find('.maintenance-banner__content').exists()).toBe(true);
262
+ expect(wrapper.find('.maintenance-banner__text-content').exists()).toBe(true);
263
+ expect(wrapper.find('.maintenance-banner__logo-section').exists()).toBe(true);
264
+ });
265
+
266
+ it('renders contact items', () => {
267
+ const wrapper = mount(MaintenanceBanner);
268
+
269
+ const contactItems = wrapper.findAll('.maintenance-banner__contact-item');
270
+ expect(contactItems.length).toBe(2); // Phone and Email
271
+ });
272
+ });
273
+
274
+ describe('Edge Cases', () => {
275
+ it('handles empty props gracefully', () => {
276
+ const wrapper = mount(MaintenanceBanner, {
277
+ props: {
278
+ title: '',
279
+ description: '',
280
+ phone: '',
281
+ email: '',
282
+ buttonText: ''
283
+ }
284
+ });
285
+
286
+ // Should fall back to defaults
287
+ expect(wrapper.find('h1').text()).toBe('Wir polieren gerade nach');
288
+ });
289
+
290
+ it('handles special characters in props', () => {
291
+ const wrapper = mount(MaintenanceBanner, {
292
+ props: {
293
+ title: 'Wartung & Pflege',
294
+ description: 'Spezialzeichen: äöü ß €'
295
+ }
296
+ });
297
+
298
+ expect(wrapper.find('h1').text()).toBe('Wartung & Pflege');
299
+ expect(wrapper.text()).toContain('äöü');
300
+ });
301
+ });
302
+ });
@@ -0,0 +1,318 @@
1
+ import { describe, it, expect } from 'vitest';
2
+
3
+ /**
4
+ * Accessibility Testing Utilities
5
+ *
6
+ * These utilities help ensure components meet WCAG 2.1 accessibility guidelines
7
+ * which are required in Germany (BITV 2.0 / EN 301 549).
8
+ */
9
+
10
+ // Helper function to check if element has accessible name
11
+ function hasAccessibleName(element: Element): boolean {
12
+ const ariaLabel = element.getAttribute('aria-label');
13
+ const ariaLabelledBy = element.getAttribute('aria-labelledby');
14
+ const title = element.getAttribute('title');
15
+ const textContent = element.textContent?.trim();
16
+
17
+ return Boolean(ariaLabel || ariaLabelledBy || title || textContent);
18
+ }
19
+
20
+ // Helper function to check if element is focusable
21
+ function isFocusable(element: Element): boolean {
22
+ const tagName = element.tagName.toLowerCase();
23
+ const tabIndex = element.getAttribute('tabindex');
24
+
25
+ // Native focusable elements
26
+ const focusableTags = ['button', 'input', 'textarea', 'select', 'details'];
27
+
28
+ if (focusableTags.includes(tagName)) {
29
+ // Check if not disabled
30
+ return !element.hasAttribute('disabled');
31
+ }
32
+
33
+ // Anchor tags are focusable only with href
34
+ if (tagName === 'a') {
35
+ return element.hasAttribute('href') && !element.hasAttribute('disabled');
36
+ }
37
+
38
+ // Elements with tabindex >= 0 are focusable
39
+ if (tabIndex !== null) {
40
+ return parseInt(tabIndex) >= 0;
41
+ }
42
+
43
+ return false;
44
+ }
45
+
46
+ // Helper function to check color contrast (simplified)
47
+ function hasMinimumContrast(foreground: string, background: string, largeText: boolean = false): boolean {
48
+ // This is a simplified check - in real tests use axe-core
49
+ // WCAG 2.1 AA requires 4.5:1 for normal text, 3:1 for large text
50
+ const minRatio = largeText ? 3 : 4.5;
51
+
52
+ // Parse hex colors
53
+ const parseHex = (hex: string): [number, number, number] => {
54
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
55
+ if (result) {
56
+ return [
57
+ parseInt(result[1], 16),
58
+ parseInt(result[2], 16),
59
+ parseInt(result[3], 16)
60
+ ];
61
+ }
62
+ return [0, 0, 0];
63
+ };
64
+
65
+ const luminance = (r: number, g: number, b: number): number => {
66
+ const [rs, gs, bs] = [r, g, b].map(c => {
67
+ const s = c / 255;
68
+ return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
69
+ });
70
+ return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
71
+ };
72
+
73
+ const [fr, fg, fb] = parseHex(foreground);
74
+ const [br, bg, bb] = parseHex(background);
75
+
76
+ const l1 = luminance(fr, fg, fb);
77
+ const l2 = luminance(br, bg, bb);
78
+
79
+ const ratio = (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
80
+
81
+ return ratio >= minRatio;
82
+ }
83
+
84
+ // Helper to check for valid heading hierarchy
85
+ function hasValidHeadingHierarchy(html: string): boolean {
86
+ const headingRegex = /<h([1-6])/g;
87
+ const matches = [...html.matchAll(headingRegex)];
88
+
89
+ if (matches.length === 0) return true;
90
+
91
+ let lastLevel = 0;
92
+ for (const match of matches) {
93
+ const level = parseInt(match[1]);
94
+ // Heading levels should not skip (e.g., h1 to h3)
95
+ if (level > lastLevel + 1 && lastLevel !== 0) {
96
+ return false;
97
+ }
98
+ lastLevel = level;
99
+ }
100
+
101
+ return true;
102
+ }
103
+
104
+ describe('Accessibility Utilities', () => {
105
+ describe('hasAccessibleName', () => {
106
+ it('returns true for element with aria-label', () => {
107
+ const div = document.createElement('div');
108
+ div.setAttribute('aria-label', 'Test label');
109
+ expect(hasAccessibleName(div)).toBe(true);
110
+ });
111
+
112
+ it('returns true for element with aria-labelledby', () => {
113
+ const div = document.createElement('div');
114
+ div.setAttribute('aria-labelledby', 'label-id');
115
+ expect(hasAccessibleName(div)).toBe(true);
116
+ });
117
+
118
+ it('returns true for element with title', () => {
119
+ const div = document.createElement('div');
120
+ div.setAttribute('title', 'Test title');
121
+ expect(hasAccessibleName(div)).toBe(true);
122
+ });
123
+
124
+ it('returns true for element with text content', () => {
125
+ const div = document.createElement('div');
126
+ div.textContent = 'Hello World';
127
+ expect(hasAccessibleName(div)).toBe(true);
128
+ });
129
+
130
+ it('returns false for empty element', () => {
131
+ const div = document.createElement('div');
132
+ expect(hasAccessibleName(div)).toBe(false);
133
+ });
134
+
135
+ it('returns false for element with only whitespace', () => {
136
+ const div = document.createElement('div');
137
+ div.textContent = ' ';
138
+ expect(hasAccessibleName(div)).toBe(false);
139
+ });
140
+ });
141
+
142
+ describe('isFocusable', () => {
143
+ it('returns true for button element', () => {
144
+ const button = document.createElement('button');
145
+ expect(isFocusable(button)).toBe(true);
146
+ });
147
+
148
+ it('returns true for input element', () => {
149
+ const input = document.createElement('input');
150
+ expect(isFocusable(input)).toBe(true);
151
+ });
152
+
153
+ it('returns true for anchor with href', () => {
154
+ const anchor = document.createElement('a');
155
+ anchor.setAttribute('href', '#');
156
+ expect(isFocusable(anchor)).toBe(true);
157
+ });
158
+
159
+ it('returns false for disabled button', () => {
160
+ const button = document.createElement('button');
161
+ button.setAttribute('disabled', '');
162
+ expect(isFocusable(button)).toBe(false);
163
+ });
164
+
165
+ it('returns true for div with tabindex 0', () => {
166
+ const div = document.createElement('div');
167
+ div.setAttribute('tabindex', '0');
168
+ expect(isFocusable(div)).toBe(true);
169
+ });
170
+
171
+ it('returns false for div with tabindex -1', () => {
172
+ const div = document.createElement('div');
173
+ div.setAttribute('tabindex', '-1');
174
+ expect(isFocusable(div)).toBe(false);
175
+ });
176
+
177
+ it('returns false for regular div', () => {
178
+ const div = document.createElement('div');
179
+ expect(isFocusable(div)).toBe(false);
180
+ });
181
+ });
182
+
183
+ describe('hasMinimumContrast', () => {
184
+ it('returns true for black on white (high contrast)', () => {
185
+ expect(hasMinimumContrast('#000000', '#FFFFFF')).toBe(true);
186
+ });
187
+
188
+ it('returns true for white on black (high contrast)', () => {
189
+ expect(hasMinimumContrast('#FFFFFF', '#000000')).toBe(true);
190
+ });
191
+
192
+ it('returns false for light gray on white (low contrast)', () => {
193
+ expect(hasMinimumContrast('#CCCCCC', '#FFFFFF')).toBe(false);
194
+ });
195
+
196
+ it('returns true for dark blue on white', () => {
197
+ expect(hasMinimumContrast('#172774', '#FFFFFF')).toBe(true);
198
+ });
199
+
200
+ it('accepts lower contrast for large text', () => {
201
+ // Large text only needs 3:1 ratio
202
+ expect(hasMinimumContrast('#777777', '#FFFFFF', true)).toBe(true);
203
+ });
204
+ });
205
+
206
+ describe('hasValidHeadingHierarchy', () => {
207
+ it('returns true for repeating same heading level', () => {
208
+ const html = '<h1>Title</h1><h2>Sub</h2><h2>Another Sub</h2>';
209
+ expect(hasValidHeadingHierarchy(html)).toBe(true);
210
+ });
211
+
212
+ it('returns true for skipped levels going down', () => {
213
+ const html = '<h1>Title</h1><h2>Sub</h2><h2>Another Sub</h2>';
214
+ expect(hasValidHeadingHierarchy(html)).toBe(true);
215
+ });
216
+
217
+ it('returns false for skipped heading levels', () => {
218
+ const html = '<h1>Title</h1><h3>Skipped h2</h3>';
219
+ expect(hasValidHeadingHierarchy(html)).toBe(false);
220
+ });
221
+
222
+ it('returns true for no headings', () => {
223
+ const html = '<p>No headings here</p>';
224
+ expect(hasValidHeadingHierarchy(html)).toBe(true);
225
+ });
226
+
227
+ it('returns true for single heading', () => {
228
+ const html = '<h1>Only one heading</h1>';
229
+ expect(hasValidHeadingHierarchy(html)).toBe(true);
230
+ });
231
+ });
232
+ });
233
+
234
+ describe('WCAG 2.1 Compliance Checklist', () => {
235
+ describe('1.1.1 Non-text Content (Level A)', () => {
236
+ it('images should have alt text or be marked decorative', () => {
237
+ const img = document.createElement('img');
238
+ img.setAttribute('alt', 'Description');
239
+ expect(img.hasAttribute('alt')).toBe(true);
240
+ });
241
+
242
+ it('decorative images should have empty alt', () => {
243
+ const img = document.createElement('img');
244
+ img.setAttribute('alt', '');
245
+ img.setAttribute('role', 'presentation');
246
+ expect(img.getAttribute('alt')).toBe('');
247
+ });
248
+ });
249
+
250
+ describe('1.3.1 Info and Relationships (Level A)', () => {
251
+ it('form inputs should have associated labels', () => {
252
+ const input = document.createElement('input');
253
+ input.setAttribute('id', 'email');
254
+ input.setAttribute('aria-label', 'Email address');
255
+
256
+ expect(input.hasAttribute('aria-label') || input.hasAttribute('aria-labelledby')).toBe(true);
257
+ });
258
+ });
259
+
260
+ describe('2.1.1 Keyboard (Level A)', () => {
261
+ it('interactive elements should be keyboard accessible', () => {
262
+ const button = document.createElement('button');
263
+ expect(isFocusable(button)).toBe(true);
264
+ });
265
+
266
+ it('custom interactive elements need tabindex', () => {
267
+ const div = document.createElement('div');
268
+ div.setAttribute('role', 'button');
269
+ div.setAttribute('tabindex', '0');
270
+ expect(isFocusable(div)).toBe(true);
271
+ });
272
+ });
273
+
274
+ describe('2.4.4 Link Purpose (Level A)', () => {
275
+ it('links should have descriptive text', () => {
276
+ const link = document.createElement('a');
277
+ link.textContent = 'Read more about accessibility';
278
+ expect(hasAccessibleName(link)).toBe(true);
279
+ });
280
+ });
281
+
282
+ describe('4.1.2 Name, Role, Value (Level A)', () => {
283
+ it('custom controls should have proper ARIA attributes', () => {
284
+ const customButton = document.createElement('div');
285
+ customButton.setAttribute('role', 'button');
286
+ customButton.setAttribute('aria-pressed', 'false');
287
+ customButton.setAttribute('tabindex', '0');
288
+ customButton.textContent = 'Toggle';
289
+
290
+ expect(customButton.getAttribute('role')).toBe('button');
291
+ expect(customButton.hasAttribute('aria-pressed')).toBe(true);
292
+ expect(isFocusable(customButton)).toBe(true);
293
+ expect(hasAccessibleName(customButton)).toBe(true);
294
+ });
295
+ });
296
+ });
297
+
298
+ describe('German Accessibility Requirements (BITV 2.0)', () => {
299
+ it('public sector websites must comply with WCAG 2.1 Level AA', () => {
300
+ // BITV 2.0 is based on EN 301 549, which references WCAG 2.1
301
+ expect(true).toBe(true); // Documentation test
302
+ });
303
+
304
+ it('deadline for compliance: September 23, 2020 for new websites', () => {
305
+ // All new public sector websites must be accessible
306
+ expect(true).toBe(true); // Documentation test
307
+ });
308
+
309
+ it('accessibility statement is required', () => {
310
+ // Websites must provide an accessibility statement
311
+ expect(true).toBe(true); // Documentation test
312
+ });
313
+
314
+ it('feedback mechanism must be provided', () => {
315
+ // Users must be able to report accessibility issues
316
+ expect(true).toBe(true); // Documentation test
317
+ });
318
+ });