Refine onboarding integration test mocks
cgen-b194d7af77dd428c8df3950f288341f8
This commit is contained in:
parent
bc3b8f9d20
commit
62971899ee
1 changed files with 5 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { describe, it, expect, beforeEach, vi } from "vitest";
|
||||
import { describe, it, expect, beforeEach, vi, type Mock } from "vitest";
|
||||
|
||||
const createStorage = () => {
|
||||
const store = new Map<string, string>();
|
||||
|
|
@ -32,6 +32,8 @@ vi.stubGlobal(
|
|||
}),
|
||||
);
|
||||
|
||||
const fetchMock = fetch as unknown as Mock;
|
||||
|
||||
vi.mock("@/lib/supabase", () => {
|
||||
const chain = () => ({
|
||||
select: () => chain(),
|
||||
|
|
@ -104,8 +106,8 @@ describe("onboarding passport flow", () => {
|
|||
beforeEach(async () => {
|
||||
localStorage.clear();
|
||||
await mockAuth.signOut();
|
||||
(fetch as unknown as vi.Mock).mockReset();
|
||||
(fetch as unknown as vi.Mock).mockResolvedValue({
|
||||
fetchMock.mockReset();
|
||||
fetchMock.mockResolvedValue({
|
||||
ok: false,
|
||||
status: 404,
|
||||
text: async () => "",
|
||||
|
|
|
|||
Loading…
Reference in a new issue