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:
@@ -3,7 +3,10 @@ import { cleanup, render } from 'vitest-browser-svelte';
|
|||||||
import { page, userEvent } from 'vitest/browser';
|
import { page, userEvent } from 'vitest/browser';
|
||||||
import JourneyAddBar from './JourneyAddBar.svelte';
|
import JourneyAddBar from './JourneyAddBar.svelte';
|
||||||
|
|
||||||
afterEach(() => cleanup());
|
afterEach(() => {
|
||||||
|
cleanup();
|
||||||
|
vi.unstubAllGlobals();
|
||||||
|
});
|
||||||
|
|
||||||
describe('JourneyAddBar — interlude flow', () => {
|
describe('JourneyAddBar — interlude flow', () => {
|
||||||
it('interlude confirm button is aria-disabled until text is non-empty', async () => {
|
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 userEvent.click(page.getByText('Brief hinzufügen'));
|
||||||
|
|
||||||
await expect.element(page.getByRole('combobox')).toBeInTheDocument();
|
await expect.element(page.getByRole('combobox')).toBeInTheDocument();
|
||||||
vi.unstubAllGlobals();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user