Test Code
-
[TDD] test code 작성하기 ( with jest, react testing library)Frontend 2022. 8. 15. 20:00
test code를 작성하기 위해, jest와 react testing library를 사용하였습니다. 1. test code의 기본 틀 describe('validation test', () => { it('when nothing input, submit button is disabled', async () => { //given & when render(); //then const submitButton = await screen.findByRole('button', { name: '계정 만들기', }); expect(submitButton).toBeDisabled(); }); it('when email is not valid, email error appear', async () => { //giv..