From 63ecde6c9994695e9c7e83040a3fd5afd5e8b56a Mon Sep 17 00:00:00 2001 From: vutukuri15 Date: Mon, 10 Mar 2025 12:01:36 -0700 Subject: [PATCH] Fixed test code --- components/__tests__/ChipDetection.test.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/__tests__/ChipDetection.test.tsx b/components/__tests__/ChipDetection.test.tsx index 2dac26c..543b17d 100644 --- a/components/__tests__/ChipDetection.test.tsx +++ b/components/__tests__/ChipDetection.test.tsx @@ -40,7 +40,7 @@ describe("ChipDetection", () => { }); afterEach(() => { - jest.restoreAllMocks(); // Reset all mocks to prevent test contamination + jest.restoreAllMocks(); }); it("renders correctly", () => { @@ -83,7 +83,11 @@ describe("ChipDetection", () => { fireEvent.press(getByText(/take a photo/i)); await waitFor(() => - expect(mockUpdateChipCount).toHaveBeenCalledWith({ red: 5, green: 3 }) + expect(mockUpdateChipCount).toHaveBeenCalledWith({ + red: 5, + green: 3, + blue: 0, + }) ); }); @@ -144,7 +148,7 @@ describe("ChipDetection", () => { choices: [ { message: { - content: JSON.stringify({ red: 5, green: 3 }), + content: JSON.stringify({ red: 5, green: 3, blue: 0 }), }, }, ], @@ -163,6 +167,7 @@ describe("ChipDetection", () => { expect(mockUpdateChipCount).toHaveBeenCalledWith({ red: 5, green: 3, + blue: 0, }) ); });