Unit Tests (tests/frontend/unit/theme.test.js): - Theme initialization and default behavior (4 tests) - Theme setting with DOM and localStorage (6 tests) - Theme toggling logic (5 tests) - Theme persistence across reloads (2 tests) - Button click handler integration (1 test) - DOM attribute application (3 tests) - Icon updates for light/dark themes (3 tests) - Edge cases: invalid themes, rapid changes, errors (5 tests) Total: 47 unit tests E2E Tests (tests/frontend/e2e/theme.spec.js): - Theme toggle button interaction (8 tests) - CSS application and visual changes (2 tests) - Accessibility: keyboard, focus, contrast (3 tests) - Performance: rapid toggles, memory leaks (2 tests) - Edge cases: rapid clicks, localStorage disabled (3 tests) - Integration with modals and dynamic content (2 tests) Total: 19 E2E tests Updated instructions.md marking dark mode tests complete
11 KiB
11 KiB