From 9e8bb0addd20c88401dd94ff11dde1610fc84364 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 12 May 2026 16:48:15 +0200 Subject: [PATCH] docs(adr-012): correct pattern note to document button+goto, not anchor+preventDefault Co-Authored-By: Claude Sonnet 4.6 --- docs/adr/012-browser-test-mocking-strategy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/adr/012-browser-test-mocking-strategy.md b/docs/adr/012-browser-test-mocking-strategy.md index b1e01ead..dc59b9f7 100644 --- a/docs/adr/012-browser-test-mocking-strategy.md +++ b/docs/adr/012-browser-test-mocking-strategy.md @@ -79,7 +79,7 @@ The following `vi.mock(module, factory)` calls in browser specs are **acceptable These modules are resolved at static import time (before any test runs). Their `vi.mock` factories are served by birpc synchronously during module graph resolution, not after worker teardown. -**Pattern note:** When an overlay or dropdown contains a navigation link (``), use `e.preventDefault()` + `goto(path)` in the click handler instead of letting the browser follow the `href`. In a vitest-browser Playwright iframe there is no SvelteKit router, so a real navigation tears down the orchestrator iframe and crashes the test run. The `href` attribute should still be present for right-click / open-in-new-tab semantics. +**Pattern note:** When an overlay or dropdown triggers a navigation action, use `