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
51
e2e/member-profile.spec.js
Normal file
51
e2e/member-profile.spec.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import { test, expect } from './helpers/fixtures.js'
|
||||
|
||||
test.describe('Member profile page', () => {
|
||||
test('profile page loads', async ({ adminPage }) => {
|
||||
await adminPage.goto('/member/profile')
|
||||
await expect(adminPage.getByText('Edit Profile')).toBeVisible()
|
||||
await expect(adminPage.getByText('How you appear to other members')).toBeVisible()
|
||||
})
|
||||
|
||||
test('form fields are present', async ({ adminPage }) => {
|
||||
await adminPage.goto('/member/profile')
|
||||
|
||||
// Name input
|
||||
await expect(adminPage.locator('input[placeholder="Your name"]')).toBeVisible()
|
||||
|
||||
// Bio textarea
|
||||
await expect(adminPage.locator('textarea[placeholder*="Share your background"]')).toBeVisible()
|
||||
|
||||
// Save button
|
||||
await expect(adminPage.getByRole('button', { name: 'Save Profile' })).toBeVisible()
|
||||
})
|
||||
|
||||
test('bio field accepts input', async ({ adminPage }) => {
|
||||
await adminPage.goto('/member/profile')
|
||||
|
||||
const bio = adminPage.locator('textarea[placeholder*="Share your background"]')
|
||||
const saveBtn = adminPage.getByRole('button', { name: 'Save Profile' })
|
||||
|
||||
// Save button should start disabled (no changes yet)
|
||||
await expect(saveBtn).toBeDisabled()
|
||||
|
||||
// Clear and type new text
|
||||
await bio.clear()
|
||||
await bio.fill('Game designer exploring cooperative structures')
|
||||
|
||||
// Save button should now be enabled
|
||||
await expect(saveBtn).toBeEnabled()
|
||||
})
|
||||
|
||||
test('pronouns field editable', async ({ adminPage }) => {
|
||||
await adminPage.goto('/member/profile')
|
||||
|
||||
const pronouns = adminPage.locator('input[placeholder="e.g., she/her, they/them"]')
|
||||
await expect(pronouns).toBeVisible()
|
||||
|
||||
await pronouns.clear()
|
||||
await pronouns.fill('they/them')
|
||||
|
||||
await expect(pronouns).toHaveValue('they/them')
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue