Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,33 @@ jobs:
working-directory: dashboard
run: npm test --silent

accessibility:
name: Accessibility (axe audit)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: dashboard/package-lock.json
- name: Install dependencies
working-directory: dashboard
run: npm ci
# Audits key UI components with axe-core. Fails the build on critical
# violations; all findings are written to dashboard/a11y-report.md.
- name: Run accessibility audit
working-directory: dashboard
run: npm run test:a11y
- name: Upload accessibility report
if: always()
uses: actions/upload-artifact@v4
with:
name: accessibility-report
path: dashboard/a11y-report.md
if-no-files-found: warn

rust:
name: Rust (fmt check, tests)
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions dashboard/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
.DS_Store
a11y-report.md
10 changes: 10 additions & 0 deletions dashboard/jest.a11y.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Dedicated configuration for the accessibility audit suite. It reuses the base
// Jest setup but only runs `*.a11y.test.tsx` files, which render components and
// validate them with axe-core, emitting a readable report.
const base = require('./jest.config.cjs');

module.exports = {
...base,
testMatch: ['<rootDir>/src/**/*.a11y.test.{ts,tsx}'],
testPathIgnorePatterns: ['/node_modules/'],
};
3 changes: 3 additions & 0 deletions dashboard/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'jsdom',
// The dedicated accessibility suite (`*.a11y.test.tsx`) runs via
// `npm run test:a11y` / jest.a11y.config.cjs, so keep it out of the default run.
testPathIgnorePatterns: ['/node_modules/', '\\.a11y\\.test\\.'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.cjs'],
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleNameMapper: {
Expand Down
Loading
Loading