Skip to content

test(dashboardPeriod-accessibility): verify Accessibility Standards &…#4859

Open
adityapandey4621 wants to merge 2 commits into
JhaSourav07:mainfrom
adityapandey4621:test/dashboard-period-accessibility
Open

test(dashboardPeriod-accessibility): verify Accessibility Standards &…#4859
adityapandey4621 wants to merge 2 commits into
JhaSourav07:mainfrom
adityapandey4621:test/dashboard-period-accessibility

Conversation

@adityapandey4621
Copy link
Copy Markdown
Contributor

Description

Adds isolated unit and integration testing for the dashboardPeriod utility, focusing specifically on Accessibility Standards & Screen Reader Aria Compliance. Because this utility processes logic rather than rendering HTML natively, a standard DashboardPeriodAccessibleView mock component was built directly within the test suite to safely map the utility's dynamic properties (labels, from/to bounds) directly into ARIA accessibility parameters and perform compliance validation on the resulting DOM.

Implementation details:

  • Inspected markup to verify aria-labelledby and aria-describedby correctly mapped the utility's dynamic date outputs to native regions.
  • Asserted elements that accept key focus (like the mapped date-range button) successfully maintained focus:outline-2 visible outline behaviors.
  • Verified native role="tooltip" wrappers correctly announced the dynamic period.label output to screen readers.
  • Utilized @testing-library/user-event to simulate keyboard navigation and confirm standard tab ordering successfully trapped focus on the target components.
  • Confirmed that standard hierarchical headings (h1, h2) maintained logical grouping structures surrounding the period metrics.
  • Successfully achieved 100% test completion via 5 newly authored Vitest tests.

Fixes #4655

Pillar

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

Visual Preview

N/A (Test-only change verifying ARIA compliance mappings)

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME) (N/A).
  • 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).
  • I have started 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).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant