ghostguild-org/e2e/member-profile.spec.js
Jennie Robinson Faber c40f2c7c63 fix: accessibility improvements and test infrastructure hardening
Add aria-labels to form controls (selects, checkboxes, switches), set
html lang attribute and page title, fix color contrast for --candle-dim
and --text-faint tokens, underline inline links, remove opacity hack.
Harden dev login endpoints with atomic findOneAndUpdate and tokenVersion
in JWT. Update Playwright timeouts and E2E test helpers.
2026-04-05 21:59:02 +01:00

55 lines
2.1 KiB
JavaScript

import { test, expect } from './helpers/fixtures.js'
test.describe('Member profile page', () => {
test('profile page loads', async ({ adminPage }) => {
await adminPage.goto('/member/profile')
// Auth is checked client-side in onMounted — wait for profile form to render
await expect(adminPage.getByText('Edit Profile')).toBeVisible({ timeout: 15000 })
await expect(adminPage.getByText('How you appear to other members')).toBeVisible()
})
test('form fields are present', async ({ adminPage }) => {
await adminPage.goto('/member/profile')
await expect(adminPage.getByText('Edit Profile')).toBeVisible({ timeout: 15000 })
// 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')
await expect(adminPage.getByText('Edit Profile')).toBeVisible({ timeout: 15000 })
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')
await expect(adminPage.getByText('Edit Profile')).toBeVisible({ timeout: 15000 })
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')
})
})