test(planner): clear shared mocks before each RecipePickerDrawer test

Adds beforeEach(vi.clearAllMocks) to prevent shared vi.fn() state in
baseProps from leaking across tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit was merged in pull request #54.
This commit is contained in:
2026-04-10 14:18:50 +02:00
parent 4835231f6d
commit cfbde18435

View File

@@ -1,4 +1,4 @@
import { describe, it, expect, vi } from 'vitest'; import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen } from '@testing-library/svelte'; import { render, screen } from '@testing-library/svelte';
import { userEvent } from '@testing-library/user-event'; import { userEvent } from '@testing-library/user-event';
import RecipePickerDrawer from './RecipePickerDrawer.svelte'; import RecipePickerDrawer from './RecipePickerDrawer.svelte';
@@ -18,6 +18,7 @@ const baseProps = {
}; };
describe('RecipePickerDrawer', () => { describe('RecipePickerDrawer', () => {
beforeEach(() => vi.clearAllMocks());
describe('visibility', () => { describe('visibility', () => {
it('renders drawer content when open=true', () => { it('renders drawer content when open=true', () => {
render(RecipePickerDrawer, { props: baseProps }); render(RecipePickerDrawer, { props: baseProps });