diff --git a/frontend/bun.lockb b/frontend/bun.lockb index 59b4202..860ea48 100755 Binary files a/frontend/bun.lockb and b/frontend/bun.lockb differ diff --git a/frontend/index.html b/frontend/index.html index 2712db4..16e55da 100755 --- a/frontend/index.html +++ b/frontend/index.html @@ -6,7 +6,7 @@ - + %VITE_TITLE% diff --git a/frontend/package.json b/frontend/package.json index 3b6dbf9..a2950b3 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -66,7 +66,6 @@ "@typescript-eslint/eslint-plugin": "^8.2.0", "@typescript-eslint/parser": "^8.2.0", "@vitejs/plugin-react-swc": "^3.7.0", - "apca-check": "^0.1.1", "eslint-plugin-jsx-a11y": "^6.9.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react-hooks": "^4.6.2", diff --git a/frontend/public/mockServiceWorker.js b/frontend/public/mockServiceWorker.js index b7301a5..a8262f0 100644 --- a/frontend/public/mockServiceWorker.js +++ b/frontend/public/mockServiceWorker.js @@ -281,4 +281,4 @@ async function respondWithMock(response) { }) return mockedResponse -} \ No newline at end of file +} diff --git a/frontend/src/assets/collapse.svg b/frontend/src/assets/collapse.svg index f6a2260..95a1f52 100644 --- a/frontend/src/assets/collapse.svg +++ b/frontend/src/assets/collapse.svg @@ -6,20 +6,16 @@ stroke-linecap="round" stroke-linejoin="round" d=" - M -44 -35 - L -44 35 - M 44 -35 - L 44 35 - M 20 -15 - L 5 0 - L 20 15 - M -20 -15 - L -5 0 - L -20 15 M -44 0 - L -5 0 + L -10 0 + M -30 -20 + L -10 0 + L -30 20 M 44 0 - L 5 0 + L 10 0 + M 30 -20 + L 10 0 + L 30 20 " /> diff --git a/frontend/src/assets/expand.svg b/frontend/src/assets/expand.svg index e95c0a7..c30c410 100644 --- a/frontend/src/assets/expand.svg +++ b/frontend/src/assets/expand.svg @@ -6,18 +6,16 @@ stroke-linecap="round" stroke-linejoin="round" d=" - M -44 -30 - L -44 30 - M 44 -30 - L 44 30 - M -18 -15 - L -33 0 - L -18 15 - M 18 -15 - L 33 0 - L 18 15 - M -33 0 - L 33 0 + M -10 0 + L -44 0 + M -24 -20 + L -44 0 + L -24 20 + M 10 0 + L 44 0 + M 24 -20 + L 44 0 + L 24 20 " /> diff --git a/frontend/tests/accessibility.spec.ts b/frontend/tests/accessibility.spec.ts index fb0d4d1..13d8560 100755 --- a/frontend/tests/accessibility.spec.ts +++ b/frontend/tests/accessibility.spec.ts @@ -1,4 +1,3 @@ -import registerAPCACheck from "apca-check"; import { AxeBuilder } from "@axe-core/playwright"; import { expect, test } from "@playwright/test"; import analyses from "@/fixtures/analyses.json" with { type: "json" }; @@ -16,9 +15,6 @@ const paths = [ ...analyses.map((analysis) => `/analysis/${analysis.id}`), ]; -/** NOT WORKING YET https://github.com/StackExchange/apca-check/issues/143 */ -registerAPCACheck("bronze"); - /** generic page axe test */ const checkPage = (path: string) => test(`Accessibility check ${path}`, async ({ page, browserName }) => { @@ -34,11 +30,26 @@ const checkPage = (path: string) => /** axe check */ const check = async () => { - const { violations } = await new AxeBuilder({ page }) - /** https://github.com/dequelabs/axe-core/issues/3325 */ - .options({ rules: { "color-contrast": { enabled: false } } }) - .analyze(); - expect(violations).toEqual([]); + /** get page violations */ + const { violations } = await new AxeBuilder({ page }).analyze(); + + const warnRules = [ + /** just warn about color-contrast violations */ + /** https://github.com/dequelabs/axe-core/issues/3325#issuecomment-2383832705 */ + "color-contrast", + ]; + + /** split up critical/non-critical violations */ + const isCritical = + (match: boolean) => (violation: (typeof violations)[number]) => + !warnRules.includes(violation.id) === match; + const criticals = violations.filter(isCritical(true)); + const warnings = violations.filter(isCritical(false)); + + /** fail test on critical violations */ + expect(criticals).toEqual([]); + /** just console log warnings on non-critical violations */ + console.warn(warnings); }; await check();