diff --git a/src/app/__tests__/visualizarMetrica.spec.tsx b/src/app/__tests__/visualizarMetrica.spec.tsx index e8083dd1..95b8202b 100644 --- a/src/app/__tests__/visualizarMetrica.spec.tsx +++ b/src/app/__tests__/visualizarMetrica.spec.tsx @@ -130,3 +130,22 @@ test("closes the modal when 'Cancelar' is pressed", async () => { }); +test("does not show 'Novo valor' button when categoria is different", async () => { + jest.mock("expo-router", () => ({ + router: { + push: jest.fn(), + replace: jest.fn(), + }, + useLocalSearchParams: jest.fn(() => ({ + id: '123', + categoria: 'OUTRA_CATEGORIA', + })), + })); + + const { queryByText } = render(); + + await waitFor(() => { + const addButton = queryByText("Novo valor"); + expect(addButton).toBeNull(); +  }); +}); \ No newline at end of file