Skip to content

Commit

Permalink
test(sanity): mock router.perspectiveState
Browse files Browse the repository at this point in the history
  • Loading branch information
juice49 committed Oct 24, 2024
1 parent c0a16c5 commit 1a0a1e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ vi.mock('sanity/router', () => {
return {
useRouter: vi.fn().mockReturnValue({
stickyParams: {},
perspectiveState: {},
}),
route: {
create: vi.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ vi.mock('sanity', async (importOriginal) => ({
}))
vi.mock('sanity/router', async (importOriginal) => ({
...(await importOriginal()),
useRouter: vi.fn().mockReturnValue({stickyParams: {}, state: {}, navigate: vi.fn()}),
useRouter: vi.fn().mockReturnValue({
stickyParams: {},
state: {},
navigate: vi.fn(),
perspectiveState: {},
}),
}))

const mockUseSearchState = useSearchState as Mock
Expand Down

0 comments on commit 1a0a1e7

Please sign in to comment.