Skip to content

Commit

Permalink
test: new value when categoria is different
Browse files Browse the repository at this point in the history
Co-Authored-By: Natalia Rodrigues <Natytotherodrigues@gmail.com>
GabrielSMonteiro and Natyrodrigues committed Sep 19, 2024
1 parent 9b8b73a commit 3418a7b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/app/__tests__/visualizarMetrica.spec.tsx
Original file line number Diff line number Diff line change
@@ -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(<VisualizarMetrica />);

await waitFor(() => {
const addButton = queryByText("Novo valor");
expect(addButton).toBeNull();
  });
});

0 comments on commit 3418a7b

Please sign in to comment.