From 8df5b77189b7a383f475770f9a264a3b8ce20f0a Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 9 Jun 2026 14:46:28 +0200 Subject: [PATCH] fix(journey-add-bar): move vi.unstubAllGlobals into afterEach Removed the inline vi.unstubAllGlobals() call from the end of the 'reveals picker' test body and added it to the shared afterEach hook so every test in the file gets the same global cleanup regardless of which test runs. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/lib/geschichte/JourneyAddBar.svelte.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/geschichte/JourneyAddBar.svelte.spec.ts b/frontend/src/lib/geschichte/JourneyAddBar.svelte.spec.ts index 18c4936c..2bbc5988 100644 --- a/frontend/src/lib/geschichte/JourneyAddBar.svelte.spec.ts +++ b/frontend/src/lib/geschichte/JourneyAddBar.svelte.spec.ts @@ -3,7 +3,10 @@ import { cleanup, render } from 'vitest-browser-svelte'; import { page, userEvent } from 'vitest/browser'; import JourneyAddBar from './JourneyAddBar.svelte'; -afterEach(() => cleanup()); +afterEach(() => { + cleanup(); + vi.unstubAllGlobals(); +}); describe('JourneyAddBar — interlude flow', () => { it('interlude confirm button is aria-disabled until text is non-empty', async () => { @@ -48,6 +51,5 @@ describe('JourneyAddBar — document picker', () => { await userEvent.click(page.getByText('Brief hinzufügen')); await expect.element(page.getByRole('combobox')).toBeInTheDocument(); - vi.unstubAllGlobals(); }); });