Add comprehensive testing suite and fix QC issues

- Add 115+ unit, component, and E2E tests
- Add Vitest configuration with coverage thresholds
- Add validation schema tests (validations.test.ts)
- Add sanitizer utility tests (sanitizer.test.ts)
- Add WhatsApp service tests (whatsapp.test.ts)
- Add component tests for UnifiedTypography and UnifiedSurface
- Add E2E tests for admin auth and public pages
- Add testing documentation (docs/TESTING.md)
- Add sanitizer and WhatsApp utilities
- Add centralized validation schemas
- Refactor state management (admin/public separation)
- Fix security issues (OTP via POST, session password validation)
- Update AGENTS.md with testing guidelines

Test Coverage: 50%+ target achieved
All tests passing: 115/115

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-03-09 14:05:03 +08:00
parent 7bc546e985
commit 6ed2392420
46 changed files with 7734 additions and 565 deletions

View File

@@ -5,7 +5,7 @@
* Persist ke localStorage
*
* Usage:
* import { darkModeStore } from '@/state/darkModeStore';
* import { darkModeStore, useDarkMode } from '@/state/darkModeStore';
*
* // Toggle
* darkModeStore.toggle();
@@ -15,6 +15,9 @@
*
* // Get current state
* const isDark = darkModeStore.isDark;
*
* // In React components
* const { isDark, toggle, setDarkMode } = useDarkMode();
*/
import { proxy, useSnapshot } from 'valtio';