Skip to content

Commit

Permalink
fix broken test
Browse files Browse the repository at this point in the history
Needed to mock the next/router functionality since it's now being used
inside the useSession hook.
  • Loading branch information
thostetler committed Feb 2, 2024
1 parent 88ce18a commit d25dd53
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/__tests__/AbstractSources.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { render } from '@test-utils';
import Meta, { Default } from '../__stories__/AbstractSources.stories';
import { composeStory } from '@storybook/react';
import { test } from 'vitest';
import { test, vi } from 'vitest';

const AbstractSources = composeStory(Default, Meta);

vi.mock('next/router', () => ({
useRouter: () => ({
reload: vi.fn(),
}),
}));

test('renders without crashing', () => {
render(<AbstractSources />);
});

0 comments on commit d25dd53

Please sign in to comment.