File tree 2 files changed +6
-6
lines changed
cra-template/template/src
cra-template-typescript/template/src
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { render } from '@testing-library/react' ;
2
+ import { render , screen } from '@testing-library/react' ;
3
3
import App from './App' ;
4
4
5
5
test ( 'renders learn react link' , ( ) => {
6
- const { getByText } = render ( < App /> ) ;
7
- const linkElement = getByText ( / l e a r n r e a c t / i) ;
6
+ render ( < App /> ) ;
7
+ const linkElement = screen . getByText ( / l e a r n r e a c t / i) ;
8
8
expect ( linkElement ) . toBeInTheDocument ( ) ;
9
9
} ) ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { render } from '@testing-library/react' ;
2
+ import { render , screen } from '@testing-library/react' ;
3
3
import App from './App' ;
4
4
5
5
test ( 'renders learn react link' , ( ) => {
6
- const { getByText } = render ( < App /> ) ;
7
- const linkElement = getByText ( / l e a r n r e a c t / i) ;
6
+ render ( < App /> ) ;
7
+ const linkElement = screen . getByText ( / l e a r n r e a c t / i) ;
8
8
expect ( linkElement ) . toBeInTheDocument ( ) ;
9
9
} ) ;
You can’t perform that action at this time.
0 commit comments