Some checks failed
CI / Unit & Component Tests (push) Failing after 2m51s
CI / OCR Service Tests (push) Successful in 38s
CI / Backend Unit Tests (push) Failing after 2m55s
CI / Unit & Component Tests (pull_request) Failing after 2m50s
CI / OCR Service Tests (pull_request) Successful in 34s
CI / Backend Unit Tests (pull_request) Failing after 2m54s
- help-popover: replace broad button[aria-expanded] with specific
getByLabel('Lese- und Bearbeitungsmodus'); update role="tooltip" →
role="region"; add afterAll doc cleanup (Sara/Tobias)
- richtlinien: assert .new-tab spans are hidden in print media — the
existing test only checked .app-nav (Sara)
- transcribe-coach: remove 4× redundant page.emulateMedia({reducedMotion})
calls — playwright.config.ts already sets reducedMotion: 'reduce' globally;
add afterAll doc cleanup (Tobias)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
import { createEmptyDocument } from './helpers/upload-empty-document.js';
|
|
|
|
test.describe('Help chip — Read/Edit panel header', () => {
|
|
let docId: string;
|
|
|
|
test.beforeAll(async ({ request }) => {
|
|
docId = await createEmptyDocument(request);
|
|
});
|
|
|
|
test.afterAll(async ({ request }) => {
|
|
await request.delete(`/api/documents/${docId}`);
|
|
});
|
|
|
|
test('opens popover on click, closes on Esc, returns focus to chip', async ({ page }) => {
|
|
await page.goto(`/documents/${docId}`);
|
|
await page.getByRole('button', { name: 'Transkribieren' }).click();
|
|
|
|
// Use the accessible label of the HelpPopover trigger (transcription_mode_help_label)
|
|
const helpBtn = page.getByRole('button', { name: 'Lese- und Bearbeitungsmodus' });
|
|
await expect(helpBtn).toBeVisible({ timeout: 5000 });
|
|
await helpBtn.click();
|
|
|
|
// Popover should open (role="region", not tooltip — click-triggered panels are regions)
|
|
await expect(page.getByRole('region', { name: 'Lese- und Bearbeitungsmodus' })).toBeVisible();
|
|
|
|
// Press Esc
|
|
await page.keyboard.press('Escape');
|
|
await expect(
|
|
page.getByRole('region', { name: 'Lese- und Bearbeitungsmodus' })
|
|
).not.toBeVisible();
|
|
|
|
// Focus should have returned to the chip
|
|
await expect(helpBtn).toBeFocused();
|
|
});
|
|
});
|