Skip to content

Commit 7c8049f

Browse files
committed
fix: again the id in hds component
Refs: HAUKI-747
1 parent 2ab19c1 commit 7c8049f

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

e2e/tests/accessibility.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ test('Resource page has no wcag2a/wcag2aa violations', async ({ page }) => {
1919
await page
2020
.getByRole('button', { name: 'Hyväksy vain välttämättömät evästeet' })
2121
.click();
22+
23+
const essentialCookiesButton = page.getByRole('button', {
24+
name: 'Hyväksy vain välttämättömät evästeet',
25+
});
26+
if (await essentialCookiesButton.isVisible()) {
27+
await essentialCookiesButton.click();
28+
}
29+
2230
const results = await new AxeBuilder({ page })
2331
.withTags(['wcag2a', 'wcag2aa'])
2432
.analyze();

src/components/exception-opening-hours-validity/ExceptionOpeningHoursValidity.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,10 @@ const ExceptionOpeningHoursValidity = () => {
3030
className="exception-opening-hours-validity__title"
3131
label={t('OpeningHours.ExceptionOpeningHoursValidity')}
3232
required>
33-
<div className="exception-opening-hours-validity__dates">
34-
{/* HDS SelectionGroup keys its children by props.id, so give
35-
each field a stable id to avoid a missing-key warning. */}
33+
<div id="exception-date-fields" className="exception-opening-hours-validity__dates">
3634
<Controller
3735
defaultValue={startDate ?? ''}
3836
name="startDate"
39-
{...{ id: 'exception-start-date-field' }}
4037
render={({
4138
field: { name, onBlur, onChange, ref, value },
4239
fieldState,
@@ -77,7 +74,6 @@ const ExceptionOpeningHoursValidity = () => {
7774
<Controller
7875
defaultValue={endDate ?? ''}
7976
name="endDate"
80-
{...{ id: 'exception-end-date-field' }}
8177
render={({
8278
field: { name, onBlur, onChange, ref, value },
8379
fieldState,

0 commit comments

Comments
 (0)