cleanup(legibility): repo hygiene, TODO cleanup, and test flakiness fixes #456

Merged
marcel merged 1 commits from feat/issue-411-legibility-cleanup into main 2026-05-07 13:42:14 +02:00

View File

@@ -61,8 +61,14 @@ describe('Edit page — delete button', () => {
context: new Map([[CONFIRM_KEY, mockService]])
});
await page.getByRole('button', { name: /löschen/i }).click();
await vi.waitFor(() => expect(capturedOptions).not.toBeNull());
// Playwright CDP click has latency that can exceed vi.waitFor's 1000ms deadline.
// Dispatching the MouseEvent directly from browser-JS context is synchronous and
// reliably triggers Svelte 5 onclick — same pattern as GeschichteEditor.svelte.spec.ts.
const btn = (await page
.getByRole('button', { name: /löschen/i })
.element()) as HTMLButtonElement;
btn.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));
expect(capturedOptions).not.toBeNull();
expect(capturedOptions).toMatchObject({ destructive: true });
settleRef?.(false);
});