test(web): increase frontend test coverage to ~70% page coverage

- Fix vitest config to include [locale] directory tests (was excluded)
- Fix register.spec.tsx: use getByRole('heading') to avoid duplicate text match
- Fix search.spec.tsx: add QueryClientProvider wrapper and mock saved searches hook
- Add 12 new page test files covering dashboard, admin, public, and OAuth pages:
  - dashboard (main, profile, payments, subscription, KYC)
  - admin (dashboard, users)
  - public (landing, pricing)
  - analytics
  - OAuth callbacks (Google, Zalo)
- 29 test files, 174 tests, 16/23 pages covered (69.6%)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-10 23:14:16 +07:00
parent d62eb5f164
commit 68b65cb848
15 changed files with 1122 additions and 7 deletions

View File

@@ -112,7 +112,7 @@ describe('RegisterPage', () => {
it('renders register form with all fields', () => {
render(<RegisterPage />);
expect(screen.getByText('Đăng ký')).toBeInTheDocument();
expect(screen.getByRole('heading', { name: 'Đăng ký' })).toBeInTheDocument();
expect(screen.getByLabelText('Họ và tên')).toBeInTheDocument();
expect(screen.getByLabelText('Số điện thoại')).toBeInTheDocument();
expect(screen.getByLabelText(/email/i)).toBeInTheDocument();