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 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-06-09 14:46:28 +02:00
parent 06b8c99ce7
commit 8df5b77189

View File

@@ -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();
});
});