Refactor testing infrastructure + streamline CI (Node 20 only, quiet-by-default)
Overview
This PR completes a testing + CI modernization pass to make contributions easier and reduce maintenance burden.
It consolidates component tests into a single, reusable pattern (componentTestSuite), removes redundant/legacy test categories and the broken Storybook test-runner, cleans docs/build artifacts, and streamlines CI (Node 20 only; quieter logs; artifacts only on failure).
Introduced tests/utils/componentTestSuite.tsx as the standard baseline suite for component tests (render + basic a11y + optional keyboard/disabled/error smoke tests).
Migrated component-focused tests into tests/components/*.test.tsx and page-level tests into tests/pages/*.
Removed redundant legacy test files and categories (unit/integration/a11y component duplicates) in favor of the consolidated structure.
Improved test robustness by avoiding brittle DOM/styling assertions and preferring behavioral + accessibility checks.
Storybook test-runner removal (ticket: Storybook runner broken after Next.js 16)
Removed @storybook/test-runner usage and any redundant Storybook runner configuration.
Storybook remains for documentation/visual review, not automated testing.
Docs cleanup (ticket: keep only necessary docs; remove artifacts)
Cleaned docs/ to keep source documentation only; removed generated Storybook build artifacts from docs.
Centralized testing guidance in docs/TESTING_GUIDE.md and updated README.md accordingly.
Generated artifacts + git hygiene
Ensured build/test outputs are ignored and not tracked (coverage/, lhci-results/, playwright-report/, test-results/, storybook-static/).
Removed any accidentally tracked generated Lighthouse output from git and fixed .gitignore duplication.
CI optimization: remove Node 18 matrix (ticket: CI runs tests twice)
Updated .gitea/workflows/ci.yaml to run tests only on Node 20 (consistent with other jobs).
Added engines.node >=20.0.0 in package.json and documented Node 20+ requirements in README.md.
CI maintainability + noise reduction (follow-up improvement)
Standardized Node version via workflow env, added concurrency cancelation, and changed artifacts to upload only on failure.
Follow-up fixes discovered by running CI-style tests
Fixed a11y issues surfaced by jest-axe by removing invalid ARIA roles, avoiding empty headings, and making aria-labelledby target real IDs (via a new titleId prop in ContentLockup).
Fixed a broken partial mock in tests/components/ContentBanner.test.tsx to preserve ASSETS.
Updated page test to avoid jsdom “navigation not implemented” by verifying link structure rather than clicking.
Reduced test noise by refactoring tests/unit/Layout.test.jsx (avoid rendering <html> under RTL container) and mocking logger in content-processing tests.
Screenshots
How to Test
Install deps:
npm ci
Run component/page/unit tests:
npm test
Run a focused component test:
npm run test:component -- --run tests/components/Button.test.tsx
CI now targets Node 20 only; this is documented in README.md and enforced in package.json via engines.
Component accessibility is enforced via jest-axe in the standard suite; full-page WCAG checks remain in Playwright E2E (tests/accessibility/e2e/).
CI artifacts (Playwright/LHCI) upload only on failure to keep runs clean while preserving debuggability when needed.
# Refactor testing infrastructure + streamline CI (Node 20 only, quiet-by-default)
## Overview
This PR completes a testing + CI modernization pass to make contributions easier and reduce maintenance burden.
It consolidates component tests into a single, reusable pattern (`componentTestSuite`), removes redundant/legacy test categories and the broken Storybook test-runner, cleans docs/build artifacts, and streamlines CI (Node 20 only; quieter logs; artifacts only on failure).
## Changes
- **Testing refactor (ticket: simplify & consolidate testing)**
- Introduced `tests/utils/componentTestSuite.tsx` as the standard baseline suite for component tests (render + basic a11y + optional keyboard/disabled/error smoke tests).
- Migrated component-focused tests into `tests/components/*.test.tsx` and page-level tests into `tests/pages/*`.
- Removed redundant legacy test files and categories (unit/integration/a11y component duplicates) in favor of the consolidated structure.
- Improved test robustness by avoiding brittle DOM/styling assertions and preferring behavioral + accessibility checks.
- **Storybook test-runner removal (ticket: Storybook runner broken after Next.js 16)**
- Removed `@storybook/test-runner` usage and any redundant Storybook runner configuration.
- Storybook remains for **documentation/visual review**, not automated testing.
- **Docs cleanup (ticket: keep only necessary docs; remove artifacts)**
- Cleaned `docs/` to keep source documentation only; removed generated Storybook build artifacts from docs.
- Centralized testing guidance in `docs/TESTING_GUIDE.md` and updated `README.md` accordingly.
- **Generated artifacts + git hygiene**
- Ensured build/test outputs are ignored and not tracked (`coverage/`, `lhci-results/`, `playwright-report/`, `test-results/`, `storybook-static/`).
- Removed any accidentally tracked generated Lighthouse output from git and fixed `.gitignore` duplication.
- **CI optimization: remove Node 18 matrix (ticket: CI runs tests twice)**
- Updated `.gitea/workflows/ci.yaml` to run tests only on **Node 20** (consistent with other jobs).
- Added `engines.node >=20.0.0` in `package.json` and documented Node 20+ requirements in `README.md`.
- **CI maintainability + noise reduction (follow-up improvement)**
- Quiet-by-default CI: removed high-noise test debugging, reduced shell tracing, reduced npm noise.
- Standardized Node version via workflow env, added concurrency cancelation, and changed artifacts to upload **only on failure**.
- **Follow-up fixes discovered by running CI-style tests**
- Fixed a11y issues surfaced by `jest-axe` by removing invalid ARIA roles, avoiding empty headings, and making `aria-labelledby` target real IDs (via a new `titleId` prop in `ContentLockup`).
- Fixed a broken partial mock in `tests/components/ContentBanner.test.tsx` to preserve `ASSETS`.
- Updated page test to avoid jsdom “navigation not implemented” by verifying link structure rather than clicking.
- Reduced test noise by refactoring `tests/unit/Layout.test.jsx` (avoid rendering `<html>` under RTL container) and mocking logger in content-processing tests.
## Screenshots
<!-- No UI changes requiring screenshots -->
## How to Test
1. Install deps:
- `npm ci`
2. Run component/page/unit tests:
- `npm test`
3. Run a focused component test:
- `npm run test:component -- --run tests/components/Button.test.tsx`
4. Run E2E tests:
- `npm run test:e2e`
5. Optional: Storybook (documentation/visual review):
- `npm run storybook`
## Notes
- CI now targets **Node 20** only; this is documented in `README.md` and enforced in `package.json` via `engines`.
- Component accessibility is enforced via `jest-axe` in the standard suite; full-page WCAG checks remain in Playwright E2E (`tests/accessibility/e2e/`).
- CI artifacts (Playwright/LHCI) upload only on failure to keep runs clean while preserving debuggability when needed.
an.di
self-assigned this 2026-01-28 21:52:57 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Refactor testing infrastructure + streamline CI (Node 20 only, quiet-by-default)
Overview
This PR completes a testing + CI modernization pass to make contributions easier and reduce maintenance burden.
It consolidates component tests into a single, reusable pattern (
componentTestSuite), removes redundant/legacy test categories and the broken Storybook test-runner, cleans docs/build artifacts, and streamlines CI (Node 20 only; quieter logs; artifacts only on failure).Changes
Testing refactor (ticket: simplify & consolidate testing)
tests/utils/componentTestSuite.tsxas the standard baseline suite for component tests (render + basic a11y + optional keyboard/disabled/error smoke tests).tests/components/*.test.tsxand page-level tests intotests/pages/*.Storybook test-runner removal (ticket: Storybook runner broken after Next.js 16)
@storybook/test-runnerusage and any redundant Storybook runner configuration.Docs cleanup (ticket: keep only necessary docs; remove artifacts)
docs/to keep source documentation only; removed generated Storybook build artifacts from docs.docs/TESTING_GUIDE.mdand updatedREADME.mdaccordingly.Generated artifacts + git hygiene
coverage/,lhci-results/,playwright-report/,test-results/,storybook-static/)..gitignoreduplication.CI optimization: remove Node 18 matrix (ticket: CI runs tests twice)
.gitea/workflows/ci.yamlto run tests only on Node 20 (consistent with other jobs).engines.node >=20.0.0inpackage.jsonand documented Node 20+ requirements inREADME.md.CI maintainability + noise reduction (follow-up improvement)
Follow-up fixes discovered by running CI-style tests
jest-axeby removing invalid ARIA roles, avoiding empty headings, and makingaria-labelledbytarget real IDs (via a newtitleIdprop inContentLockup).tests/components/ContentBanner.test.tsxto preserveASSETS.tests/unit/Layout.test.jsx(avoid rendering<html>under RTL container) and mocking logger in content-processing tests.Screenshots
How to Test
Install deps:
npm ciRun component/page/unit tests:
npm testRun a focused component test:
npm run test:component -- --run tests/components/Button.test.tsxRun E2E tests:
npm run test:e2eOptional: Storybook (documentation/visual review):
npm run storybookNotes
README.mdand enforced inpackage.jsonviaengines.jest-axein the standard suite; full-page WCAG checks remain in Playwright E2E (tests/accessibility/e2e/).