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
23
e2e/helpers/fixtures.js
Normal file
23
e2e/helpers/fixtures.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { test as base } from '@playwright/test'
|
||||
import { loginAsAdmin, loginAsMember } from './auth.js'
|
||||
|
||||
/**
|
||||
* Extended test fixtures with pre-authenticated pages.
|
||||
*/
|
||||
export const test = base.extend({
|
||||
adminPage: async ({ page }, use) => {
|
||||
await loginAsAdmin(page)
|
||||
await use(page)
|
||||
},
|
||||
memberPage: async ({ browser }, use) => {
|
||||
// Uses a default test member — tests needing a specific member
|
||||
// should use loginAsMember directly
|
||||
const context = await browser.newContext()
|
||||
const page = await context.newPage()
|
||||
await loginAsMember(page, 'test-admin@ghostguild.dev')
|
||||
await use(page)
|
||||
await context.close()
|
||||
},
|
||||
})
|
||||
|
||||
export { expect } from '@playwright/test'
|
||||
Loading…
Add table
Add a link
Reference in a new issue