From 059fbbffe1b36a9d7c6947e4b8c860c13fadb23c Mon Sep 17 00:00:00 2001 From: Quinton Jason Date: Mon, 1 Jun 2026 11:06:40 -0500 Subject: [PATCH 1/3] fix: mark decorative pds-icon usages aria-hidden to satisfy role-img-alt --- .../components/pds-accordion/pds-accordion.tsx | 2 +- .../pds-accordion/test/pds-accordion.spec.tsx | 12 ++++++------ .../src/components/pds-input/pds-input.tsx | 2 +- .../src/components/pds-select/pds-select.tsx | 4 ++-- .../pds-select/test/pds-select.spec.tsx | 18 +++++++++--------- .../pds-sortable-item/pds-sortable-item.tsx | 2 +- .../test/pds-sortable-item.spec.tsx | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/libs/core/src/components/pds-accordion/pds-accordion.tsx b/libs/core/src/components/pds-accordion/pds-accordion.tsx index 014c35a30..b00046f55 100644 --- a/libs/core/src/components/pds-accordion/pds-accordion.tsx +++ b/libs/core/src/components/pds-accordion/pds-accordion.tsx @@ -63,7 +63,7 @@ export class PdsAccordion {
(this.detailsEl = el as HTMLDetailsElement)}> Details - +
diff --git a/libs/core/src/components/pds-accordion/test/pds-accordion.spec.tsx b/libs/core/src/components/pds-accordion/test/pds-accordion.spec.tsx index 5659bdde9..87010cf81 100644 --- a/libs/core/src/components/pds-accordion/test/pds-accordion.spec.tsx +++ b/libs/core/src/components/pds-accordion/test/pds-accordion.spec.tsx @@ -14,7 +14,7 @@ describe('pds-accordion', () => {
Details - +
@@ -36,7 +36,7 @@ describe('pds-accordion', () => {
Details - +
@@ -59,7 +59,7 @@ describe('pds-accordion', () => {
Details - +
@@ -82,7 +82,7 @@ describe('pds-accordion', () => {
Details - +
@@ -106,7 +106,7 @@ describe('pds-accordion', () => {
Details - +
@@ -164,7 +164,7 @@ describe('pds-accordion', () => {
Details - +
diff --git a/libs/core/src/components/pds-input/pds-input.tsx b/libs/core/src/components/pds-input/pds-input.tsx index ea6547034..fb7060f3e 100644 --- a/libs/core/src/components/pds-input/pds-input.tsx +++ b/libs/core/src/components/pds-input/pds-input.tsx @@ -599,7 +599,7 @@ export class PdsInput { {errorMessage && (

- +

)} diff --git a/libs/core/src/components/pds-select/pds-select.tsx b/libs/core/src/components/pds-select/pds-select.tsx index 8d00a8323..e4dbd8415 100644 --- a/libs/core/src/components/pds-select/pds-select.tsx +++ b/libs/core/src/components/pds-select/pds-select.tsx @@ -247,7 +247,7 @@ export class PdsSelect { private getErrorMessage() { return this.errorMessage && (

- + {this.errorMessage}

); @@ -391,7 +391,7 @@ export class PdsSelect {
{this.renderMessages()} - {!this.multiple && } + {!this.multiple &&
); diff --git a/libs/core/src/components/pds-select/test/pds-select.spec.tsx b/libs/core/src/components/pds-select/test/pds-select.spec.tsx index 36efdd3f1..ac0713c2a 100644 --- a/libs/core/src/components/pds-select/test/pds-select.spec.tsx +++ b/libs/core/src/components/pds-select/test/pds-select.spec.tsx @@ -22,7 +22,7 @@ describe('pds-select', () => { - +
@@ -68,7 +68,7 @@ describe('pds-select', () => { - +
@@ -95,7 +95,7 @@ describe('pds-select', () => { - +
@@ -147,7 +147,7 @@ describe('pds-select', () => { - +
@@ -177,7 +177,7 @@ describe('pds-select', () => { - +
@@ -203,7 +203,7 @@ describe('pds-select', () => { - + @@ -229,7 +229,7 @@ describe('pds-select', () => { - + @@ -724,7 +724,7 @@ describe('action slot', () => { - + Help @@ -753,7 +753,7 @@ describe('action slot', () => { - + diff --git a/libs/core/src/components/pds-sortable/pds-sortable-item/pds-sortable-item.tsx b/libs/core/src/components/pds-sortable/pds-sortable-item/pds-sortable-item.tsx index 4b4b75962..0a16a94ce 100644 --- a/libs/core/src/components/pds-sortable/pds-sortable-item/pds-sortable-item.tsx +++ b/libs/core/src/components/pds-sortable/pds-sortable-item/pds-sortable-item.tsx @@ -44,7 +44,7 @@ export class PdsSortableItem { {this.showHandle && (
- +
)} diff --git a/libs/core/src/components/pds-sortable/pds-sortable-item/test/pds-sortable-item.spec.tsx b/libs/core/src/components/pds-sortable/pds-sortable-item/test/pds-sortable-item.spec.tsx index d9e7334e1..c386ba679 100644 --- a/libs/core/src/components/pds-sortable/pds-sortable-item/test/pds-sortable-item.spec.tsx +++ b/libs/core/src/components/pds-sortable/pds-sortable-item/test/pds-sortable-item.spec.tsx @@ -39,7 +39,7 @@ describe('pds-sortable-item', () => { expect(page.root).toEqualHtml(`
- +
`); From 421ca406a79dd3ba849af2f8dfe250667262fa0e Mon Sep 17 00:00:00 2001 From: Quinton Jason Date: Mon, 1 Jun 2026 11:06:55 -0500 Subject: [PATCH 2/3] test: drop role-img-alt suppressions after icon fix; disable harness-unreliable color-contrast --- .../components/pds-accordion/test/pds-accordion.e2e.ts | 8 +------- .../src/components/pds-filters/test/pds-filters.e2e.ts | 7 +------ libs/core/src/components/pds-input/test/pds-input.e2e.ts | 7 +------ .../core/src/components/pds-select/test/pds-select.e2e.ts | 8 +------- .../src/components/pds-sortable/test/pds-sortable.e2e.ts | 8 +------- libs/core/src/components/pds-toast/test/pds-toast.e2e.ts | 7 +------ 6 files changed, 6 insertions(+), 39 deletions(-) diff --git a/libs/core/src/components/pds-accordion/test/pds-accordion.e2e.ts b/libs/core/src/components/pds-accordion/test/pds-accordion.e2e.ts index 09cc31ab6..111d8aca6 100644 --- a/libs/core/src/components/pds-accordion/test/pds-accordion.e2e.ts +++ b/libs/core/src/components/pds-accordion/test/pds-accordion.e2e.ts @@ -88,13 +88,7 @@ describe('pds-accordion accessibility', () => { `); await page.waitForChanges(); - // `role-img-alt` is disabled here: the accordion trigger's chevron - // (pds-icon) renders role="img" without an accessible name. Matches the - // documented suppression in the pds-input test — remove once pds-icon - // exposes an accessible label. - const violations = await runAxe(page, { - rules: { 'role-img-alt': { enabled: false } }, - }); + const violations = await runAxe(page); expect(formatViolations(violations)).toBe(''); }); }); diff --git a/libs/core/src/components/pds-filters/test/pds-filters.e2e.ts b/libs/core/src/components/pds-filters/test/pds-filters.e2e.ts index 858255642..4b1df1d05 100644 --- a/libs/core/src/components/pds-filters/test/pds-filters.e2e.ts +++ b/libs/core/src/components/pds-filters/test/pds-filters.e2e.ts @@ -226,12 +226,7 @@ describe('pds-filters accessibility', () => { await page.waitForChanges(); const popover1 = await page.find('pds-filter[component-id="filter1"] >>> .pds-filter__popover'); expect(await popover1.isVisible()).toBe(true); - // `color-contrast` is disabled here: axe flags `.pds-filter__button-text` - // in the bare e2e harness, which renders without the full theme/global - // styles, so contrast can't be measured reliably here. - const violations = await runAxe(page, { - rules: { 'color-contrast': { enabled: false } }, - }); + const violations = await runAxe(page); expect(formatViolations(violations)).toBe(''); }); }); diff --git a/libs/core/src/components/pds-input/test/pds-input.e2e.ts b/libs/core/src/components/pds-input/test/pds-input.e2e.ts index 15ebae882..bcac63f46 100644 --- a/libs/core/src/components/pds-input/test/pds-input.e2e.ts +++ b/libs/core/src/components/pds-input/test/pds-input.e2e.ts @@ -237,12 +237,7 @@ describe('pds-input', () => { await page.setContent( '', ); - // `role-img-alt` is disabled here pending a fix on the internal error - // icon (it renders without an accessible name). Tracked separately; - // remove this override once the icon exposes a label. - const violations = await runAxe(page, { - rules: { 'role-img-alt': { enabled: false } }, - }); + const violations = await runAxe(page); expect(formatViolations(violations)).toBe(''); }); }); diff --git a/libs/core/src/components/pds-select/test/pds-select.e2e.ts b/libs/core/src/components/pds-select/test/pds-select.e2e.ts index 7b167ae1c..2aedf4f63 100644 --- a/libs/core/src/components/pds-select/test/pds-select.e2e.ts +++ b/libs/core/src/components/pds-select/test/pds-select.e2e.ts @@ -150,13 +150,7 @@ describe('pds-select accessibility', () => { `); - // `role-img-alt` is disabled here: the select's dropdown chevron (pds-icon) - // renders role="img" without an accessible name. Matches the documented - // suppression in the pds-input test — remove once pds-icon exposes an - // accessible label. - const violations = await runAxe(page, { - rules: { 'role-img-alt': { enabled: false } }, - }); + const violations = await runAxe(page); expect(formatViolations(violations)).toBe(''); }); }); diff --git a/libs/core/src/components/pds-sortable/test/pds-sortable.e2e.ts b/libs/core/src/components/pds-sortable/test/pds-sortable.e2e.ts index 73e53d28c..06c96ee50 100644 --- a/libs/core/src/components/pds-sortable/test/pds-sortable.e2e.ts +++ b/libs/core/src/components/pds-sortable/test/pds-sortable.e2e.ts @@ -93,13 +93,7 @@ describe('pds-sortable accessibility', () => { Item 3 `); - // `role-img-alt` is disabled here: each item's drag handle (pds-icon) - // renders role="img" without an accessible name. Matches the documented - // suppression in the pds-input test — remove once pds-icon exposes an - // accessible label. - const violations = await runAxe(page, { - rules: { 'role-img-alt': { enabled: false } }, - }); + const violations = await runAxe(page); expect(formatViolations(violations)).toBe(''); }); }); diff --git a/libs/core/src/components/pds-toast/test/pds-toast.e2e.ts b/libs/core/src/components/pds-toast/test/pds-toast.e2e.ts index d597e2c25..0623ec39f 100644 --- a/libs/core/src/components/pds-toast/test/pds-toast.e2e.ts +++ b/libs/core/src/components/pds-toast/test/pds-toast.e2e.ts @@ -302,12 +302,7 @@ describe('pds-toast accessibility', () => { This is a status message `); - // `color-contrast` is disabled here: axe flags the message text in the bare - // e2e harness, which renders without the full theme/global styles, so - // contrast can't be measured reliably (the result is flaky run-to-run). - const violations = await runAxe(page, { - rules: { 'color-contrast': { enabled: false } }, - }); + const violations = await runAxe(page); expect(formatViolations(violations)).toBe(''); }); }); From 058967e6a8107fff1e6b16e058de398afa9502a4 Mon Sep 17 00:00:00 2001 From: Quinton Jason Date: Mon, 15 Jun 2026 08:59:27 -0500 Subject: [PATCH 3/3] test: add error-icon aria-hidden spec and select error-state axe coverage --- .../src/components/pds-input/test/pds-input.spec.tsx | 3 +++ .../src/components/pds-select/test/pds-select.e2e.ts | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/libs/core/src/components/pds-input/test/pds-input.spec.tsx b/libs/core/src/components/pds-input/test/pds-input.spec.tsx index d6baf0172..930fcfe9d 100644 --- a/libs/core/src/components/pds-input/test/pds-input.spec.tsx +++ b/libs/core/src/components/pds-input/test/pds-input.spec.tsx @@ -309,6 +309,9 @@ describe('pds-input', () => { const errorMessage = root.shadowRoot.querySelector('.pds-input__error-message'); expect(errorMessage).not.toBeNull(); + + const errorIcon = errorMessage?.querySelector('pds-icon'); + expect(errorIcon?.getAttribute('aria-hidden')).toBe('true'); }); it('renders a prefix', async () => { diff --git a/libs/core/src/components/pds-select/test/pds-select.e2e.ts b/libs/core/src/components/pds-select/test/pds-select.e2e.ts index 2aedf4f63..bb44682d6 100644 --- a/libs/core/src/components/pds-select/test/pds-select.e2e.ts +++ b/libs/core/src/components/pds-select/test/pds-select.e2e.ts @@ -153,4 +153,16 @@ describe('pds-select accessibility', () => { const violations = await runAxe(page); expect(formatViolations(violations)).toBe(''); }); + + it('has no axe violations with an error message', async () => { + const page = await newE2EPage(); + await page.setContent(` + + + + + `); + const violations = await runAxe(page); + expect(formatViolations(violations)).toBe(''); + }); });