feat: add testing infrastructure — Vitest, Playwright, CI, git hooks
Add comprehensive testing covering 420 unit/handler tests across 24 Vitest files, 9 Playwright E2E specs, accessibility scans, and visual regression. Includes GitHub Actions CI, Husky pre-push hook, and TESTING.md docs.
This commit is contained in:
parent
036af95e00
commit
1e30ba23cd
35 changed files with 3637 additions and 5 deletions
35
e2e/member-dashboard.spec.js
Normal file
35
e2e/member-dashboard.spec.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { test, expect } from './helpers/fixtures.js'
|
||||
|
||||
test.describe('Member dashboard', () => {
|
||||
test('dashboard loads for authenticated user', async ({ adminPage }) => {
|
||||
await adminPage.goto('/member/dashboard')
|
||||
|
||||
await expect(adminPage.getByText('Welcome back')).toBeVisible({ timeout: 10000 })
|
||||
})
|
||||
|
||||
test('shows navigation links', async ({ adminPage }) => {
|
||||
await adminPage.goto('/member/dashboard')
|
||||
|
||||
// Wait for dashboard content to render
|
||||
await expect(adminPage.getByText('Welcome back')).toBeVisible({ timeout: 10000 })
|
||||
|
||||
// Verify quick action links are present
|
||||
await expect(adminPage.getByText('Update your profile')).toBeVisible()
|
||||
await expect(adminPage.getByText('Browse members')).toBeVisible()
|
||||
await expect(adminPage.getByText('Manage account')).toBeVisible()
|
||||
})
|
||||
|
||||
test('unauthenticated shows sign-in prompt', async ({ browser }) => {
|
||||
const context = await browser.newContext()
|
||||
const page = await context.newPage()
|
||||
|
||||
await page.goto('/member/dashboard')
|
||||
|
||||
// Should show the sign-in required message or a login modal
|
||||
await expect(
|
||||
page.getByText('Sign in required').or(page.getByText('Sign in to your dashboard'))
|
||||
).toBeVisible({ timeout: 10000 })
|
||||
|
||||
await context.close()
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue