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.
This commit is contained in:
Jennie Robinson Faber 2026-04-05 21:59:02 +01:00
parent 61c16d8bac
commit c40f2c7c63
35 changed files with 787 additions and 173 deletions

View file

@ -12,14 +12,19 @@ test.describe('Admin members page', () => {
await adminPage.goto('/admin/members')
const searchInput = adminPage.getByPlaceholder('Search members...')
await expect(searchInput).toBeVisible()
await expect(searchInput).toBeVisible({ timeout: 10000 })
// Wait for the initial member list to load before searching
await expect(
adminPage.locator('table').or(adminPage.getByText('No members found matching your criteria'))
).toBeVisible({ timeout: 15000 })
await searchInput.fill('nonexistent-query-xyz')
// Page should not crash -- either shows filtered results or the empty state
await expect(
adminPage.locator('table').or(adminPage.getByText('No members found matching your criteria'))
).toBeVisible()
).toBeVisible({ timeout: 10000 })
})
test('non-admin redirect', async ({ browser }) => {
@ -38,11 +43,16 @@ test.describe('Admin members page', () => {
test('add member button opens modal', async ({ adminPage }) => {
await adminPage.goto('/admin/members')
await adminPage.getByRole('button', { name: 'Add Member' }).click()
// Wait for page to fully load and hydrate
await expect(adminPage.locator('h1')).toHaveText('Members')
await adminPage.waitForLoadState('networkidle')
const addBtn = adminPage.getByRole('button', { name: 'Add Member' })
await expect(addBtn).toBeVisible({ timeout: 10000 })
await addBtn.click()
// Modal should appear with the form heading and fields
await expect(adminPage.getByText('Add New Member')).toBeVisible()
await expect(adminPage.getByPlaceholder('Full name')).toBeVisible()
await expect(adminPage.getByPlaceholder('Full name')).toBeVisible({ timeout: 10000 })
await expect(adminPage.getByPlaceholder('email@example.com')).toBeVisible()
})
})