fix(notification): replace view-all anchor with button to prevent iframe navigation
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 1m47s
CI / OCR Service Tests (pull_request) Successful in 15s
CI / Unit & Component Tests (push) Failing after 1m51s
CI / OCR Service Tests (push) Successful in 17s
CI / Backend Unit Tests (push) Successful in 4m12s
CI / fail2ban Regex (push) Successful in 38s
CI / Compose Bucket Idempotency (push) Failing after 11s
CI / Backend Unit Tests (pull_request) Successful in 4m19s
CI / fail2ban Regex (pull_request) Successful in 37s
CI / Compose Bucket Idempotency (pull_request) Failing after 10s
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 1m47s
CI / OCR Service Tests (pull_request) Successful in 15s
CI / Unit & Component Tests (push) Failing after 1m51s
CI / OCR Service Tests (push) Successful in 17s
CI / Backend Unit Tests (push) Successful in 4m12s
CI / fail2ban Regex (push) Successful in 38s
CI / Compose Bucket Idempotency (push) Failing after 11s
CI / Backend Unit Tests (pull_request) Successful in 4m19s
CI / fail2ban Regex (pull_request) Successful in 37s
CI / Compose Bucket Idempotency (pull_request) Failing after 10s
SvelteKit's capture-phase link interceptor fires before the component's onclick handler, so e.preventDefault() was structurally too late to stop iframe navigation in vitest-browser. Replacing the <a href> with a <button type="button"> removes the href entirely — the interceptor never fires — and the existing goto() mock in tests is sufficient. Also splits the single view-all test into two focused it() blocks and clears mocks in afterEach to prevent cross-test mock leakage. Fixes #551 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,8 +13,7 @@ type Props = {
|
||||
|
||||
let { notifications, onMarkRead, onMarkAllRead, onClose }: Props = $props();
|
||||
|
||||
function handleViewAll(e: MouseEvent) {
|
||||
e.preventDefault();
|
||||
function handleViewAll() {
|
||||
onClose();
|
||||
goto('/aktivitaeten');
|
||||
}
|
||||
@@ -134,12 +133,12 @@ function handleViewAll(e: MouseEvent) {
|
||||
{/if}
|
||||
|
||||
<div class="border-t border-line px-4 py-2">
|
||||
<a
|
||||
href="/aktivitaeten"
|
||||
<button
|
||||
type="button"
|
||||
onclick={handleViewAll}
|
||||
class="text-xs font-medium text-ink-2 transition-colors hover:text-ink"
|
||||
>
|
||||
{m.chronik_view_all()}
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user