File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -561,7 +561,9 @@ test('can fill in the form after loaded', async () => {
561561
562562 // wait until the callback does not throw an error. In this case, that means
563563 // it'll wait until the element with the text that says "loading..." is gone.
564- await wait (() => expect (queryByText (/ loading\.\.\. / i ).not .toBeInTheDOM ()))
564+ await wait (() =>
565+ expect (queryByText (/ loading\.\.\. / i ).not .toBeInTheDocument ()),
566+ )
565567 getByLabelText (' username' ).value = ' chucknorris'
566568 // continue doing stuff
567569})
@@ -658,7 +660,7 @@ import {render} from 'react-testing-library'
658660const {queryAllByText } = render (<Forms />)
659661const submitButtons = queryAllByText (' submit' )
660662expect (submitButtons ).toHaveLength (3 ) // expect 3 elements
661- expect (submitButtons [0 ]).toBeInTheDOM ()
663+ expect (submitButtons [0 ]).toBeInTheDocument ()
662664` ` `
663665
664666## Examples
Original file line number Diff line number Diff line change @@ -43,11 +43,11 @@ test('works great with react portals', () => {
4343 }
4444
4545 const { unmount, getByTestId, getByText} = render ( < MyPortal /> )
46- expect ( getByText ( 'Hello World' ) ) . toBeInTheDOM ( )
46+ expect ( getByText ( 'Hello World' ) ) . toBeInTheDocument ( )
4747 const portalNode = getByTestId ( 'my-portal' )
48- expect ( document . body . contains ( portalNode ) ) . toBe ( true )
48+ expect ( portalNode ) . toBeInTheDocument ( )
4949 unmount ( )
50- expect ( document . body . contains ( portalNode ) ) . toBe ( false )
50+ expect ( portalNode ) . not . toBeInTheDocument ( )
5151} )
5252
5353test ( 'returns baseElement which defaults to document.body' , ( ) => {
You can’t perform that action at this time.
0 commit comments