fix(tests): use native element clicks in layout dropdown spec #563

Merged
marcel merged 1 commits from fix/layout-dropdown-native-clicks into main 2026-05-14 11:07:23 +02:00
Owner

Summary

  • CDP-based Playwright locator.click() calls don't reliably trigger Svelte 5 onclick handlers — documented and fixed in commit 0c765d81 across 13 other specs; the layout dropdown tests were missed in that pass
  • Replaces all 4 await page.getByRole('button', { name: /MM/ }).click() calls with ((await locator.element()) as HTMLElement).click() (native DOM click)
  • Replaces userEvent.keyboard('{Escape}') with btnEl.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true })) dispatched on the button so it bubbles to the parent div's onkeydown handler
  • Removes now-unused userEvent import

Test Plan

  • CI browser test Layout – user dropdown > profile link points to /profile no longer fails intermittently
  • All 5 dropdown tests in layout.svelte.spec.ts pass consistently
## Summary - CDP-based Playwright `locator.click()` calls don't reliably trigger Svelte 5 `onclick` handlers — documented and fixed in commit `0c765d81` across 13 other specs; the layout dropdown tests were missed in that pass - Replaces all 4 `await page.getByRole('button', { name: /MM/ }).click()` calls with `((await locator.element()) as HTMLElement).click()` (native DOM click) - Replaces `userEvent.keyboard('{Escape}')` with `btnEl.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }))` dispatched on the button so it bubbles to the parent div's `onkeydown` handler - Removes now-unused `userEvent` import ## Test Plan - [ ] CI browser test `Layout – user dropdown > profile link points to /profile` no longer fails intermittently - [ ] All 5 dropdown tests in `layout.svelte.spec.ts` pass consistently
marcel added 1 commit 2026-05-14 11:04:38 +02:00
fix(tests): use native element clicks in layout dropdown spec
Some checks failed
CI / Unit & Component Tests (push) Has been cancelled
CI / OCR Service Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / fail2ban Regex (push) Has been cancelled
CI / Compose Bucket Idempotency (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Has been cancelled
CI / OCR Service Tests (pull_request) Has been cancelled
CI / Backend Unit Tests (pull_request) Has been cancelled
CI / fail2ban Regex (pull_request) Has been cancelled
CI / Compose Bucket Idempotency (pull_request) Has been cancelled
8319ca79ed
CDP-based Playwright clicks (locator.click()) do not reliably trigger
Svelte 5 onclick handlers — documented in commit 0c765d81 which fixed
13 other specs. The layout dropdown tests were missed in that pass.

Applies the same pattern: ((await locator.element()) as HTMLElement).click()
for button interactions, and native KeyboardEvent dispatch for the Escape
test (dispatched on the button so it bubbles to the parent div's onkeydown).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
marcel merged commit e268e2dbca into main 2026-05-14 11:07:23 +02:00
marcel deleted branch fix/layout-dropdown-native-clicks 2026-05-14 11:07:24 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#563