Skip to content

feat(frontend): fix appearance.test.tsx and add theme e2e tests#809

Merged
aji70 merged 1 commit into
MyFanss:mainfrom
Inkman007:feat/theme-dark-light-system
Apr 24, 2026
Merged

feat(frontend): fix appearance.test.tsx and add theme e2e tests#809
aji70 merged 1 commit into
MyFanss:mainfrom
Inkman007:feat/theme-dark-light-system

Conversation

@Inkman007
Copy link
Copy Markdown
Contributor

appearance.test.tsx:

  • Remove broken ReactNode.useState reference (ReactNode is a type, not a namespace with a useState method)
  • Wire ThemeAppearanceSection directly to useTheme() from ThemeContext so preference state and setTheme come from the real context
  • Add test for active-state update when preference changes

e2e/theme-persistence.spec.ts:

  • Verify default (no stored value) resolves to a valid theme
  • Verify dark/light/system preferences persist across page reload
  • Verify NoFlashScript applies data-theme before React hydrates
  • Verify color-scheme style matches resolved theme
  • Verify ThemeSelect dropdown (settings page) updates storage + attribute

Closes #627

appearance.test.tsx:
- Remove broken ReactNode.useState reference (ReactNode is a type,
  not a namespace with a useState method)
- Wire ThemeAppearanceSection directly to useTheme() from ThemeContext
  so preference state and setTheme come from the real context
- Add test for active-state update when preference changes

e2e/theme-persistence.spec.ts:
- Verify default (no stored value) resolves to a valid theme
- Verify dark/light/system preferences persist across page reload
- Verify NoFlashScript applies data-theme before React hydrates
- Verify color-scheme style matches resolved theme
- Verify ThemeSelect dropdown (settings page) updates storage + attribute

Closes issue MyFanss#24 (dark/light/system theme).
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 24, 2026

@Inkman007 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

@aji70 aji70 merged commit 5d695b0 into MyFanss:main Apr 24, 2026
3 of 9 checks passed
aji70 added a commit that referenced this pull request Apr 30, 2026
feat(frontend): fix appearance.test.tsx and add theme e2e tests
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.

Dark / light / system theme

2 participants