Skip to content

Commit

Permalink
adding the save function test to editarRotina file
Browse files Browse the repository at this point in the history
Co-authored-by: Jessica <[email protected]>
  • Loading branch information
GustaaSZ and Jkluiza committed Sep 20, 2024
1 parent 5ccb674 commit fbe362a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/__tests__/editarRotina.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,16 @@ describe("EditarRotina Component", () => {

expect(screen.getByText('Ativar notificação')).toBeTruthy();
});

test('deve chamar a função de salvar com os dados corretos', async () => {
render(<EditarRotina />);

fireEvent.changeText(screen.getByPlaceholderText('Adicionar título'), 'Título Teste');
fireEvent.changeText(screen.getByPlaceholderText('Data da rotina'), '25/09/2024');
fireEvent.changeText(screen.getByPlaceholderText('Horário de início'), '14:30');
fireEvent.changeText(screen.getByPlaceholderText('Descrição'), 'Descrição Teste');

fireEvent.press(screen.getByText('Salvar'));
});

});

0 comments on commit fbe362a

Please sign in to comment.