Fixed issue with extra colors of image input # 57 #58

Merged
Vutukuri15 merged 2 commits from vutukuri15/57 into main 2025-03-10 12:08:52 -07:00
Showing only changes of commit 63ecde6c99 - Show all commits

View File

@ -40,7 +40,7 @@ describe("ChipDetection", () => {
}); });
afterEach(() => { afterEach(() => {
jest.restoreAllMocks(); // Reset all mocks to prevent test contamination jest.restoreAllMocks();
}); });
it("renders correctly", () => { it("renders correctly", () => {
@ -83,7 +83,11 @@ describe("ChipDetection", () => {
fireEvent.press(getByText(/take a photo/i)); fireEvent.press(getByText(/take a photo/i));
await waitFor(() => 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: [ choices: [
{ {
message: { 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({ expect(mockUpdateChipCount).toHaveBeenCalledWith({
red: 5, red: 5,
green: 3, green: 3,
blue: 0,
}) })
); );
}); });