Created
January 10, 2021 16:31
-
-
Save mariocsantos/53e9909869f6a596b254556af4a1c306 to your computer and use it in GitHub Desktop.
Favorite foods test with waitFor function.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { render, screen, waitFor } from '@testing-library/react'; | |
import { FavoriteFoodList } from '../FavoriteFoodList'; | |
describe('FavoriteFoodList', () => { | |
it('should render my favorites food', async () => { | |
render(<FavoriteFoodList />); | |
await waitFor(() => expect(screen.getAllByRole('listitem')).toHaveLength(3)); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment