Skip to content

test(layoutConstants): add accessibility tests (#4639)#4872

Open
soumyasekharshee265-ux wants to merge 1 commit into
JhaSourav07:mainfrom
soumyasekharshee265-ux:test/layoutConstants-accessibility-4639
Open

test(layoutConstants): add accessibility tests (#4639)#4872
soumyasekharshee265-ux wants to merge 1 commit into
JhaSourav07:mainfrom
soumyasekharshee265-ux:test/layoutConstants-accessibility-4639

Conversation

@soumyasekharshee265-ux
Copy link
Copy Markdown
Contributor

Description

Fixes #4639

This PR adds a new test file lib/svg/layoutConstants.accessibility.test.ts that verifies Accessibility Standards & Screen Reader ARIA Compliance for the SVG layout constants module (lib/svg/layoutConstants.ts).

Since layoutConstants.ts exports numeric constants (heights, scale multipliers, tile dimensions, grid origin) — not DOM elements — the accessibility tests focus on the applicable concerns for layout values that drive visible SVG geometry:

  • WCAG 1.4.10 (Reflow) — All height values are positive and finite so towers actually render visibly for screen-reader users (invisible towers cannot be announced)
  • WCAG 1.4.4 (Resize Text) / Clipping safety — Max heights stay below the SVG viewport (<200px) so content never clips off-canvas and out of assistive-tech reach
  • WCAG 1.3.1 (Info & Relationships) — Scale multipliers preserve a predictable visual hierarchy (LOG_SCALE_MULTIPLIER > LINEAR_SCALE_MULTIPLIER), so low-activity users still see meaningful tower shapes
  • Focus order safety — Grid origin is anchored inside the SVG canvas bounds (0 < X < 600, 0 < Y < 420) so the rendered city stays in the visible focus order
  • WCAG 4.1.1 (Parsing) — Isometric tile halves maintain the required 2:1 ratio (TILE_WIDTH_HALF > TILE_HEIGHT_HALF) so tower geometry stays parseable for the <title> accessibility tags required by CONTRIBUTING.md

Test results: 5/5 tests pass in npx vitest run lib/svg/layoutConstants.accessibility.test.ts (8ms duration).

Note: A few pre-existing test failures unrelated to this PR exist on main (proxy.accessibility.test.ts, components/dashboard/HistoricalTrendView.empty-fallback.test.tsx, app/components/CopyRepoButton.massive-scaling.test.tsx). Verified by running tests on a clean main checkout before this branch was created.

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs) — Testing / Accessibility coverage

Visual Preview

No visual changes — this PR only adds a new test file. No source code, themes, or SVG output is modified.

Test run output:

✓ lib/svg/layoutConstants.accessibility.test.ts (5 tests) 8ms
  ✓ Layout Constants Accessibility (5)
    ✓ provides positive height values so towers render visibly for screen-reader users
    ✓ caps tower heights below the SVG viewport so content never clips out of assistive-tech reach
    ✓ exposes positive scale multipliers so contribution data maps to a predictable visual hierarchy
    ✓ anchors the grid origin inside the SVG canvas so the rendered city is reachable by visual focus order
    ✓ keeps isometric tile halves positive so tower geometry stays parseable for screen-reader title tags

Test Files  1 passed (1)
Tests       5 passed (5)

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (npx vitest run lib/svg/layoutConstants.accessibility.test.ts — all 5 tests pass).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter. (N/A — no new theme or URL parameter added)
  • I have starred the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). (N/A — no SVG output changes)
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jun 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 7, 2026

🚨 Hey @soumyasekharshee265-ux, the CI Pipeline is failing on this PR and it has been marked as status:blocked.

Please fix the issues before this can be reviewed. Here's how:

1. Run checks locally before pushing:

npm run format:check   # Check Prettier formatting
npm run lint           # Run ESLint
npm run typecheck      # TypeScript type check
npm run test           # Run unit tests (Vitest)
npm run build          # Verify production build passes

2. Auto-fix common issues:

npm run format         # Auto-fix formatting with Prettier
npm run lint -- --fix  # Auto-fix lint errors where possible

3. Check the full failure log here:
👉 View CI Run

Once you push a fix and the CI passes, the status:blocked label will be removed automatically. 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:blocked This PR is blocked due to a failing CI check.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(layoutConstants-accessibility): verify Accessibility Standards & Screen Reader Aria Compliance (Variation 4)

2 participants