File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ import { render, waitForElementToBeRemoved } from '@testing-library/vue'
22import Disappearance from './components/Disappearance'
33import '@testing-library/jest-dom/extend-expect'
44
5- test ( 'it waits for the data to be loaded' , async ( ) => {
5+ test ( 'waits for the data to be loaded' , async ( ) => {
66 const { getByText, queryByText, queryByTestId } = render ( Disappearance )
77
88 // Assert initial state
99 getByText ( 'Loading...' )
1010 expect ( queryByText ( / L o a d e d t h i s m e s s a g e / ) ) . not . toBeInTheDocument ( )
1111
12- // Line reads as follows "Wait until element with test 'Loading...' is gone."
12+ // Line reads as follows: "Wait until element with text 'Loading...' is gone."
1313 await waitForElementToBeRemoved ( ( ) => queryByText ( 'Loading...' ) )
1414 // It is equivalent to:
1515 //
@@ -19,8 +19,7 @@ test('it waits for the data to be loaded', async () => {
1919 //
2020 // `wait()` waits until the callback function passes or times out.
2121
22- // After 'Loading...' element is gone, we can assert that fetched data is
23- // rendered.
22+ // After 'Loading...' is gone, we can assert that fetched data is rendered.
2423 expect ( queryByTestId ( 'message' ) ) . toHaveTextContent ( / H e l l o W o r l d / )
2524
2625 // Read more about async utilities:
You can’t perform that action at this time.
0 commit comments