test(actions): add defaultPrevented coverage for clickOutside (#195)

The action already checks event.defaultPrevented before dispatching
clickoutside, but that branch had no test. Add the missing case and
add a one-line comment explaining why capture phase is used.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-15 12:46:04 +02:00
parent 731cdc75ab
commit 4446e80875
2 changed files with 13 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ export function clickOutside(node: HTMLElement): { destroy: () => void } {
}
}
// Capture phase (true) ensures this fires before any child stopPropagation() calls.
document.addEventListener('click', handleClick, true);
return {