Skip to content

feat: add dark_mode_switcher component with RTL unit tests (Closes #319) - #347

Merged
godamongstmen897 merged 2 commits into
Goldii-locks:mainfrom
Max-Owolabi:feat/dark-mode-switcher-tests
Aug 31, 2026
Merged

feat: add dark_mode_switcher component with RTL unit tests (Closes #319)#347
godamongstmen897 merged 2 commits into
Goldii-locks:mainfrom
Max-Owolabi:feat/dark-mode-switcher-tests

Conversation

@Max-Owolabi

Copy link
Copy Markdown
Contributor

Summary

Implements the app dark/light theme toggle (dark_mode_switcher) as a keyboard-operable, ARIA-compliant native switch, plus the requested React Testing Library unit tests.

Resolves #319

Changes

  • app/components/dark_mode_switcher.tsx — new theme toggle:
    • Rendered as role="switch" on a native <button> (Tab to focus, Enter/Space to toggle).
    • Exposes state via aria-checked and an accessible name (aria-label) that announces the next mode.
    • Honors the OS color-scheme preference, applies the theme to the document root, and persists to localStorage.
    • focus-visible rings and design-token colors.
  • __tests__/dark_mode_switcher.test.tsx — 13 RTL tests covering node rendering, aria-checked state, theme application, keyboard operation (Enter/Space), and persistence/restore.

Verification

  • tsc --noEmit passes.
  • ESLint passes on the new files.
  • All 13 new tests pass; full-suite results show no new failures versus main (the only failing tests are pre-existing and unrelated to this change).

Implements the app dark/light theme toggle as a keyboard-operable,
ARIA-compliant switch (role=switch, aria-checked, aria-label) that
persists the chosen theme to localStorage and applies it to the document
root. Adds React Testing Library tests verifying node rendering,
accessible state, theme application, keyboard operation and persistence.

Closes Goldii-locks#319
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@Max-Owolabi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@godamongstmen897
godamongstmen897 merged commit b4c747f into Goldii-locks:main Aug 31, 2026
1 check passed
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.

Write React Testing Library unit tests for dark_mode_switcher

2 participants