diff --git a/eslint.config.mjs b/eslint.config.mjs index 6fb77756e..c5a2a2bbe 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -31,7 +31,13 @@ const recommendedTypeScriptWarnings = asWarnings([ // full rationale (GSA/sam-ui-elements#584). recommendedTypeScriptWarnings["@angular-eslint/prefer-standalone"] = "off"; -const accessibilityWarnings = asWarnings(angular.configs.templateAccessibility); +// Template accessibility debt (see #583) has been fully resolved: every rule +// in `angular.configs.templateAccessibility` currently has 0 findings across +// both workspaces. Per #580's promotion policy ("resolved rule categories are +// promoted from warnings to errors"), these are enforced as errors directly +// from the plugin's own recommended severities rather than downgraded to +// warnings, so any future regression fails the build immediately instead of +// silently inflating the warning baseline. // @angular-eslint/prefer-inject is intentionally disabled, not just // downgraded to a warning: angular-eslint 20's tsRecommended config newly @@ -96,6 +102,5 @@ export default tseslint.config( { files: ["**/*.html"], extends: angular.configs.templateAccessibility, - rules: accessibilityWarnings, } ); diff --git a/src/ui-kit/components/comments/comment/comment.spec.ts b/src/ui-kit/components/comments/comment/comment.spec.ts index baa0ec431..d4eb5205b 100755 --- a/src/ui-kit/components/comments/comment/comment.spec.ts +++ b/src/ui-kit/components/comments/comment/comment.spec.ts @@ -53,4 +53,9 @@ describe("The Sam Comment component", () => { const imageEl = fixture.debugElement.query(By.css("img")).nativeElement; expect(imageEl.src).toBe(comment.image); }); + + it("Should provide a text alternative for the image (decorative, since the figcaption already names the user)", function () { + const imageEl = fixture.debugElement.query(By.css("img")).nativeElement; + expect(imageEl.getAttribute("alt")).toBe(""); + }); }); diff --git a/src/ui-kit/components/comments/comment/comment.template.html b/src/ui-kit/components/comments/comment/comment.template.html index 02b2dd81d..2c26c45a3 100755 --- a/src/ui-kit/components/comments/comment/comment.template.html +++ b/src/ui-kit/components/comments/comment/comment.template.html @@ -2,7 +2,7 @@
- +
Icon for user {{comment.username}}
diff --git a/src/ui-kit/components/header-next/header.spec.ts b/src/ui-kit/components/header-next/header.spec.ts index 3f54392d5..780c79f36 100755 --- a/src/ui-kit/components/header-next/header.spec.ts +++ b/src/ui-kit/components/header-next/header.spec.ts @@ -63,6 +63,26 @@ describe("SamHeaderNextComponent", () => { expect(logoElement.getAttribute("src")).toBe(logoPath); }); + it("should mark the mobile nav overlay as presentational (click-to-close only, not independently focusable)", () => { + fixture.detectChanges(); + + const overlay: HTMLElement = + fixture.nativeElement.querySelector(".usa-overlay"); + expect(overlay.getAttribute("role")).toBe("presentation"); + }); + + it("should close the mobile nav when the overlay is clicked", () => { + component.mobileNavActive = true; + fixture.detectChanges(); + + const overlay: HTMLElement = + fixture.nativeElement.querySelector(".usa-overlay"); + overlay.click(); + fixture.detectChanges(); + + expect(component.mobileNavActive).toBe(false); + }); + it.skip("should add notifications indicator to menu button", () => { component.notifications = true; fixture.detectChanges(); diff --git a/src/ui-kit/components/header-next/header.template.html b/src/ui-kit/components/header-next/header.template.html index 077737ad3..e5a438182 100755 --- a/src/ui-kit/components/header-next/header.template.html +++ b/src/ui-kit/components/header-next/header.template.html @@ -1,5 +1,6 @@ @@ -33,6 +34,7 @@