fix(tests): resolve 10 failing browser-mode tests
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 6m5s
CI / OCR Service Tests (pull_request) Successful in 22s
CI / Backend Unit Tests (pull_request) Successful in 3m55s
CI / fail2ban Regex (pull_request) Successful in 45s
CI / Semgrep Security Scan (pull_request) Successful in 23s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m4s
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 6m5s
CI / OCR Service Tests (pull_request) Successful in 22s
CI / Backend Unit Tests (pull_request) Successful in 3m55s
CI / fail2ban Regex (pull_request) Successful in 45s
CI / Semgrep Security Scan (pull_request) Successful in 23s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m4s
- Import layout.css in test-setup so Tailwind utilities (text-xs, min-h-[44px]) apply in vitest-browser — fixes computed-style assertions for badge font-size and touch-target height - radioGroupNav: write aria-checked directly on radio buttons on arrow-key navigation, not only via the optional onChangeFn callback - DashboardNeedsMetadata spec: tighten footer-link matcher from /50/ to /Alle 50/ — avoids strict-mode collision with row link whose relative time text also contains "50" (uploadedAt is exactly 50 days ago today) - geschichten/[id] page spec: add missing await on userEvent.click before confirmService.settle() in both delete tests - TypeSelector spec: replace storyCard.focus() (not on vitest-browser Locator) with userEvent.click(); force-dispatch aria-disabled Weiter click via element.click() to bypass Playwright actionability check Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -236,7 +236,7 @@ describe('geschichten/[id] page', () => {
|
||||
|
||||
// Trigger delete — opens confirm dialog
|
||||
const deleteBtn = page.getByRole('button', { name: /löschen/i });
|
||||
userEvent.click(deleteBtn);
|
||||
await userEvent.click(deleteBtn);
|
||||
|
||||
// Settle the confirmation dialog
|
||||
confirmService.settle(true);
|
||||
@@ -262,7 +262,7 @@ describe('geschichten/[id] page', () => {
|
||||
|
||||
// Trigger delete — opens confirm dialog
|
||||
const deleteBtn = page.getByRole('button', { name: /löschen/i });
|
||||
userEvent.click(deleteBtn);
|
||||
await userEvent.click(deleteBtn);
|
||||
|
||||
// Settle the confirmation dialog
|
||||
confirmService.settle(true);
|
||||
|
||||
@@ -85,8 +85,9 @@ describe('TypeSelector', () => {
|
||||
const onweiter = vi.fn();
|
||||
render(TypeSelector, { props: { onweiter } });
|
||||
|
||||
const weiter = page.getByRole('button', { name: /Weiter/i });
|
||||
await userEvent.click(weiter);
|
||||
// aria-disabled="true" prevents Playwright actionability — dispatch via DOM to test handler behaviour
|
||||
const weiter = document.querySelector<HTMLButtonElement>('button[aria-disabled="true"]');
|
||||
weiter?.click();
|
||||
|
||||
expect(onweiter).not.toHaveBeenCalled();
|
||||
});
|
||||
@@ -101,7 +102,7 @@ describe('TypeSelector', () => {
|
||||
render(TypeSelector, { props: { onweiter: vi.fn() } });
|
||||
|
||||
const storyCard = page.getByRole('radio', { name: /Geschichte/i });
|
||||
await storyCard.focus();
|
||||
await userEvent.click(storyCard); // click focuses the card; .focus() is not on vitest-browser Locator
|
||||
await userEvent.keyboard('{ArrowRight}');
|
||||
|
||||
const journeyCard = page.getByRole('radio', { name: /Lesereise/i });
|
||||
@@ -113,7 +114,7 @@ describe('TypeSelector', () => {
|
||||
render(TypeSelector, { props: { onweiter: vi.fn() } });
|
||||
|
||||
const storyCard = page.getByRole('radio', { name: /Geschichte/i });
|
||||
await storyCard.focus();
|
||||
await userEvent.click(storyCard); // click focuses the card; .focus() is not on vitest-browser Locator
|
||||
await userEvent.keyboard('{ArrowLeft}');
|
||||
|
||||
const journeyCard = page.getByRole('radio', { name: /Lesereise/i });
|
||||
|
||||
Reference in New Issue
Block a user