Simplify Testing Structure #28

Merged
an.di merged 11 commits from adilallo/maintenance/SimplifyTestingStructure into main 2026-01-29 02:00:24 +00:00
Owner

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

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.
# 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
an.di added 6 commits 2026-01-28 21:52:58 +00:00
an.di added 1 commit 2026-01-28 22:01:13 +00:00
an.di added 1 commit 2026-01-28 22:03:24 +00:00
an.di added 1 commit 2026-01-28 22:35:28 +00:00
Update ci.yaml
CI Pipeline / e2e (chromium) (pull_request) Failing after 2m18s
CI Pipeline / e2e (firefox) (pull_request) Failing after 3m31s
CI Pipeline / test (pull_request) Successful in 6m33s
CI Pipeline / e2e (webkit) (pull_request) Failing after 2m19s
CI Pipeline / visual-regression (pull_request) Failing after 4m25s
CI Pipeline / performance (pull_request) Failing after 3m45s
CI Pipeline / lint (pull_request) Failing after 3m24s
CI Pipeline / build (pull_request) Failing after 1m0s
CI Pipeline / storybook (pull_request) Successful in 7m11s
2652015e80
an.di added 1 commit 2026-01-28 22:58:02 +00:00
Fix TypeScript matcher typing issue
CI Pipeline / test (pull_request) Successful in 7m5s
CI Pipeline / lint (pull_request) Has been cancelled
CI Pipeline / build (pull_request) Has been cancelled
CI Pipeline / e2e (webkit) (pull_request) Has been cancelled
CI Pipeline / e2e (chromium) (pull_request) Successful in 54m11s
CI Pipeline / e2e (firefox) (pull_request) Failing after 22m9s
CI Pipeline / visual-regression (pull_request) Successful in 11m50s
CI Pipeline / performance (pull_request) Successful in 13m59s
9cb89162ab
an.di added 1 commit 2026-01-29 01:23:11 +00:00
Update E2E tests and simplify performance tests
CI Pipeline / e2e (chromium) (pull_request) Successful in 6m13s
CI Pipeline / e2e (firefox) (pull_request) Successful in 7m3s
CI Pipeline / e2e (webkit) (pull_request) Successful in 5m52s
CI Pipeline / visual-regression (pull_request) Successful in 7m48s
CI Pipeline / performance (pull_request) Successful in 7m59s
CI Pipeline / lint (pull_request) Successful in 6m16s
CI Pipeline / build (pull_request) Successful in 5m30s
CI Pipeline / test (pull_request) Successful in 6m26s
a30bf6be4c
an.di merged commit 11f32d7051 into main 2026-01-29 02:00:24 +00:00
an.di deleted branch adilallo/maintenance/SimplifyTestingStructure 2026-01-29 02:00:25 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CommunityRule/community-rule#28