diff --git a/frontend/src/components/TransactionUpdateForm/test.js b/frontend/src/components/TransactionUpdateForm/test.js index b7922a7..5ebdd44 100644 --- a/frontend/src/components/TransactionUpdateForm/test.js +++ b/frontend/src/components/TransactionUpdateForm/test.js @@ -58,4 +58,20 @@ describe('TransactionUpateForm 테스트', () => { fireEvent.click(backButton); expect(onCancle).toHaveBeenCalled(); }); + + it('삭제 버튼을 누르면 onDelete 함수가 호출된다.', () => { + const onDelete = jest.fn(); + render( + , + ); + + const deleteButton = screen.getByRole('button', { name: '삭제' }); + fireEvent.click(deleteButton); + expect(onDelete).toHaveBeenCalled(); + }); });