feat: add testing infrastructure — Vitest, Playwright, CI, git hooks
Some checks are pending
Test / vitest (push) Waiting to run
Test / playwright (push) Blocked by required conditions
Test / visual (push) Blocked by required conditions

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:
Jennie Robinson Faber 2026-04-04 16:07:21 +01:00
parent 036af95e00
commit 1e30ba23cd
35 changed files with 3637 additions and 5 deletions

41
e2e/coming-soon.spec.js Normal file
View file

@ -0,0 +1,41 @@
import { test, expect } from '@playwright/test'
test.describe('coming-soon page', () => {
test('renders with heading and login form', async ({ page }) => {
await page.goto('/coming-soon')
await expect(page.locator('h1')).toContainText('Ghost Guild')
await expect(page.locator('input[type="email"]')).toBeVisible()
await expect(page.getByRole('button', { name: 'Send Magic Link' })).toBeVisible()
})
test('shows "Coming Soon" text for unauthenticated visitors', async ({ page }) => {
await page.goto('/coming-soon')
await expect(page.getByText('Coming Soon')).toBeVisible()
})
})
test.describe('public routes accessible when gate is off', () => {
test('home page loads', async ({ page }) => {
await page.goto('/')
// Should not redirect to /coming-soon
expect(page.url()).not.toContain('/coming-soon')
await expect(page.getByText('Ghost Guild')).toBeVisible()
})
test('events page loads', async ({ page }) => {
await page.goto('/events')
expect(page.url()).not.toContain('/coming-soon')
await expect(page.locator('h1')).toContainText('Events')
})
test('join page loads', async ({ page }) => {
await page.goto('/join')
expect(page.url()).not.toContain('/coming-soon')
await expect(page.locator('h1')).toContainText('Join Ghost Guild')
})
})