From fbe362a170aeda9beaf1cc1b6218bc5f156b372b Mon Sep 17 00:00:00 2001 From: Gustavo Abrantes Date: Fri, 20 Sep 2024 15:05:51 -0300 Subject: [PATCH] adding the save function test to editarRotina file Co-authored-by: Jessica --- src/app/__tests__/editarRotina.spec.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/__tests__/editarRotina.spec.tsx b/src/app/__tests__/editarRotina.spec.tsx index 306d3fa8..ed34aa17 100644 --- a/src/app/__tests__/editarRotina.spec.tsx +++ b/src/app/__tests__/editarRotina.spec.tsx @@ -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(); + + 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')); + }); + });