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.
36 lines
1.3 KiB
JavaScript
36 lines
1.3 KiB
JavaScript
import { test, expect } from './helpers/fixtures.js'
|
|
|
|
test.describe('Member dashboard', () => {
|
|
test('dashboard loads for authenticated user', async ({ adminPage }) => {
|
|
await adminPage.goto('/member/dashboard')
|
|
|
|
// Welcome heading includes the member's name (inside ClientOnly, may take time)
|
|
await expect(adminPage.getByText('Welcome back')).toBeVisible({ timeout: 15000 })
|
|
})
|
|
|
|
test('shows navigation links', async ({ adminPage }) => {
|
|
await adminPage.goto('/member/dashboard')
|
|
|
|
// Wait for ClientOnly dashboard content to render
|
|
await expect(adminPage.getByText('Welcome back')).toBeVisible({ timeout: 15000 })
|
|
|
|
// Verify quick action links are present
|
|
await expect(adminPage.getByText('Update your profile')).toBeVisible()
|
|
await expect(adminPage.getByText('Browse members')).toBeVisible()
|
|
await expect(adminPage.getByText('Manage account')).toBeVisible()
|
|
})
|
|
|
|
test('unauthenticated shows sign-in prompt', async ({ browser }) => {
|
|
const context = await browser.newContext()
|
|
const page = await context.newPage()
|
|
|
|
await page.goto('/member/dashboard')
|
|
|
|
// Should show the login modal or the page's sign-in required state
|
|
await expect(
|
|
page.locator('.modal-title').or(page.getByText('Sign in required'))
|
|
).toBeVisible({ timeout: 10000 })
|
|
|
|
await context.close()
|
|
})
|
|
})
|