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
21
e2e/helpers/auth.js
Normal file
21
e2e/helpers/auth.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
* Login helpers using dev endpoints.
|
||||
* These set real httpOnly JWT cookies so all middleware works naturally.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Login as admin via the dev test-login endpoint.
|
||||
* Creates a test admin user if none exists.
|
||||
*/
|
||||
export async function loginAsAdmin(page) {
|
||||
await page.goto('/api/dev/test-login')
|
||||
await page.waitForURL('**/admin**')
|
||||
}
|
||||
|
||||
/**
|
||||
* Login as a specific member by email via the dev member-login endpoint.
|
||||
*/
|
||||
export async function loginAsMember(page, email) {
|
||||
await page.goto(`/api/dev/member-login?email=${encodeURIComponent(email)}`)
|
||||
await page.waitForURL('**/member/**')
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue