File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 1
- import { MemoryRouter } from 'react-router-dom' ;
2
-
3
1
import { render } from '@testing-library/react' ;
4
2
5
3
import LoginPage from './LoginPage' ;
@@ -16,11 +14,10 @@ describe('LoginPage', () => {
16
14
} ) ;
17
15
18
16
it ( '아이디와 비밀번호를 입력할 수 있는 input과 버튼이 있다.' , ( ) => {
19
- const { getByRole, getAllByRole } = renderLoginPage ( ) ;
17
+ const { getByRole, getByLabelText } = renderLoginPage ( ) ;
20
18
21
- expect ( getAllByRole ( 'textbox' ) ) . toHaveLength ( 2 ) ;
22
19
expect ( getByRole ( 'textbox' , { name : 'E-mail' } ) ) . toBeInTheDocument ( ) ;
23
- expect ( getByRole ( 'textbox' , { name : ' Password' } ) ) . toBeInTheDocument ( ) ;
20
+ expect ( getByLabelText ( ' Password') ) . toBeInTheDocument ( ) ;
24
21
expect ( getByRole ( 'button' , { name : 'Log in' } ) ) . toBeInTheDocument ( ) ;
25
22
} ) ;
26
23
} ) ;
You can’t perform that action at this time.
0 commit comments