-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathuseLinkWithCredentialMutation.test.tsx
More file actions
41 lines (35 loc) · 1.12 KB
/
useLinkWithCredentialMutation.test.tsx
File metadata and controls
41 lines (35 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React from "react";
import { describe, expect, test, beforeEach, afterEach, vi } from "vitest";
import { renderHook, act, waitFor } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { auth, wipeAuth } from "~/testing-utils";
import { createUserWithEmailAndPassword, type User } from "firebase/auth";
const queryClient = new QueryClient({
defaultOptions: {
queries: { retry: false },
mutations: { retry: false },
},
});
const wrapper = ({ children }: { children: React.ReactNode }) => (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
);
describe("useLinkWithCredentialMutation", () => {
const email = "tqf@invertase.io";
const password = "TanstackQueryFirebase#123";
let user: User;
beforeEach(async () => {
queryClient.clear();
await wipeAuth();
const userCredential = await createUserWithEmailAndPassword(
auth,
email,
password
);
user = userCredential.user;
});
afterEach(async () => {
vi.clearAllMocks();
await auth.signOut();
});
test("", async () => {});
});