Test: cover prefers-color-scheme fallback in ThemeContext#11
Open
LucyJillMurray wants to merge 1 commit into
Open
Test: cover prefers-color-scheme fallback in ThemeContext#11LucyJillMurray wants to merge 1 commit into
LucyJillMurray wants to merge 1 commit into
Conversation
Implement tests for the OS theme preference fallback in ThemeContext. The ThemeContext provider falls back to the OS color scheme preference (via `window.matchMedia`) when there's no stored user preference. This commit adds test coverage for that behavior. Key changes: - Create `ThemeContext.test.tsx` with test cases: - Should fall back to dark mode when OS prefers dark and no stored preference - Should fall back to light mode when OS prefers light and no stored preference - Should prioritize stored user preference over OS preference - Should update stored preference on explicit user toggle Closes Joun-Mikhail#6
|
@LucyJillMurray is attempting to deploy a commit to the joun-mikhail's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: Test OS theme preference fallback in ThemeContext
Description:
Summary
This PR implements tests for the OS theme preference fallback behavior in the
ThemeContextprovider. When there's no stored user preference, the provider should fall back to the OS color scheme preference (viawindow.matchMedia).Closes #6
Changes
ThemeContext.test.tsxwith test cases:Checklist
ruff,mypy, andpytestpass for the backendnpm run lint,npm run typecheck,npm test, andnpm run buildpass for the frontend