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:
parent
61c16d8bac
commit
c40f2c7c63
35 changed files with 787 additions and 173 deletions
|
|
@ -29,11 +29,8 @@ test.describe('My Updates page', () => {
|
|||
|
||||
await page.goto('/member/my-updates')
|
||||
|
||||
await expect(
|
||||
page
|
||||
.getByText('Sign in required')
|
||||
.or(page.getByText('Sign in to view your updates'))
|
||||
).toBeVisible({ timeout: 10000 })
|
||||
// Should show the page's "Sign in required" heading
|
||||
await expect(page.locator('.state-heading')).toBeVisible({ timeout: 10000 })
|
||||
|
||||
await context.close()
|
||||
})
|
||||
|
|
@ -52,24 +49,27 @@ test.describe('New Update page', () => {
|
|||
await expect(adminPage.locator('select')).toBeVisible()
|
||||
|
||||
// Submit button exists and starts disabled (empty textarea)
|
||||
const submitBtn = adminPage.locator('button[type="submit"]')
|
||||
const submitBtn = adminPage.locator('button[type="submit"]', { hasText: 'Post Update' })
|
||||
await expect(submitBtn).toBeVisible()
|
||||
await expect(submitBtn).toBeDisabled()
|
||||
})
|
||||
|
||||
test('submit button enables when content is entered', async ({ adminPage }) => {
|
||||
await adminPage.goto('/updates/new')
|
||||
await adminPage.waitForLoadState('networkidle')
|
||||
|
||||
await expect(adminPage.locator('h1', { hasText: 'New Update' })).toBeVisible({
|
||||
timeout: 10000,
|
||||
})
|
||||
|
||||
const textarea = adminPage.locator('textarea')
|
||||
const submitBtn = adminPage.locator('button[type="submit"]')
|
||||
const submitBtn = adminPage.locator('button[type="submit"]', { hasText: 'Post Update' })
|
||||
|
||||
await expect(submitBtn).toBeDisabled()
|
||||
await textarea.fill('Test update content')
|
||||
await expect(submitBtn).toBeEnabled()
|
||||
// Use click + type to ensure Vue hydration processes the input events
|
||||
await textarea.click()
|
||||
await textarea.pressSequentially('Test update content', { delay: 10 })
|
||||
await expect(submitBtn).toBeEnabled({ timeout: 5000 })
|
||||
})
|
||||
|
||||
test('privacy selector defaults to members and has all options', async ({ adminPage }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue