Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

reset mock after test

ThieryMichel8a190f6ec090
diff --git a/src/components/atomic-crm/notes/NoteInputs.test.tsx b/src/components/atomic-crm/notes/NoteInputs.test.tsx
index a560cc79..8370c931 100644
--- a/src/components/atomic-crm/notes/NoteInputs.test.tsx
+++ b/src/components/atomic-crm/notes/NoteInputs.test.tsx
@@ -24,13 +24,16 @@ const Wrapper = ({ children }: { children: React.ReactNode }) => (
</MemoryRouter>
</QueryClientProvider>
);
+describe("NoteInputs", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ mockIsMobile.mockReturnValue(false);
+ });
-beforeEach(() => {
- vi.clearAllMocks();
- mockIsMobile.mockReturnValue(false);
-});
+ afterAll(() => {
+ vi.resetAllMocks();
+ });
-describe("NoteInputs", () => {
it("renders the note textarea", async () => {
const screen = await render(<NoteInputs />, {
wrapper: Wrapper,
diff --git a/supabase/functions/postmark/addNoteToContact.test.ts b/supabase/functions/postmark/addNoteToContact.test.ts
index 7fd2e63d..d0539082 100644
--- a/supabase/functions/postmark/addNoteToContact.test.ts
+++ b/supabase/functions/postmark/addNoteToContact.test.ts
@@ -14,11 +14,13 @@ vi.mock("../_shared/supabaseAdmin.ts", () => ({
},
}));
-beforeEach(() => {
- vi.clearAllMocks();
-});
-
describe("addNoteToContact", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ });
+ afterAll(() => {
+ vi.resetAllMocks();
+ });
describe("getOrCreateCompanyFromDomain", () => {
it("returns the existing company when it already exists in the database", async () => {
const existingCompany = { id: 1, name: "acme.com", sales_id: 42 };