Some checks failed
CI / Unit & Component Tests (push) Failing after 4m29s
CI / OCR Service Tests (push) Successful in 55s
CI / Backend Unit Tests (push) Failing after 3m16s
CI / Unit & Component Tests (pull_request) Failing after 3m3s
CI / OCR Service Tests (pull_request) Successful in 39s
CI / Backend Unit Tests (pull_request) Failing after 3m4s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
987 B
TypeScript
31 lines
987 B
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('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();
|
|
|
|
// Find and click the (?) help chip
|
|
const helpBtn = page.locator('button[aria-expanded]');
|
|
await expect(helpBtn).toBeVisible({ timeout: 5000 });
|
|
await helpBtn.click();
|
|
|
|
// Popover should open
|
|
await expect(page.locator('[role="tooltip"]')).toBeVisible();
|
|
|
|
// Press Esc
|
|
await page.keyboard.press('Escape');
|
|
await expect(page.locator('[role="tooltip"]')).not.toBeVisible();
|
|
|
|
// Focus should have returned to the chip
|
|
await expect(helpBtn).toBeFocused();
|
|
});
|
|
});
|