File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ test('movie title appears', async () => {
1717 // element is initially not present...
1818
1919 // wait for appearance
20- await wait (() => {
20+ await waitFor (() => {
2121 expect (getByText (' the lion king' )).toBeInTheDocument ()
2222 })
2323
2424 // wait for appearance and return the element
25- const movie = await waitForElement (() => getByText ( ' the lion king' ) )
25+ const movie = await findByText ( ' the lion king' )
2626})
2727```
2828
@@ -41,9 +41,9 @@ test('movie title no longer present in DOM', async () => {
4141
4242Using
4343[ ` MutationObserver ` ] ( https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver )
44- is more efficient than polling the DOM at regular intervals with ` wait ` .
44+ is more efficient than polling the DOM at regular intervals with ` waitFor ` .
4545
46- The ` wait ` [ async helper] [ async-api ] function retries until the wrapped function
46+ The ` waitFor ` [ async helper] [ async-api ] function retries until the wrapped function
4747stops throwing an error. This can be used to assert that an element disappears
4848from the page.
4949
@@ -52,7 +52,7 @@ test('movie title goes away', async () => {
5252 // element is initially present...
5353 // note use of queryBy instead of getBy to return null
5454 // instead of throwing in the query itself
55- await wait (() => {
55+ await waitFor (() => {
5656 expect (queryByText (' i, robot' )).not .toBeInTheDocument ()
5757 })
5858})
You can’t perform that action at this time.
0 commit comments