Last active
June 7, 2022 01:02
-
-
Save ErikGMatos/d1397c5330c38690ab1986e2ac893d6d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { waitFor, screen } from '@testing-library/react'; | |
describe('Component X', () => { | |
it('should render the component and to wait for something', async () => { | |
// to mount the component | |
// here you wait for some element/text | |
await waitFor(() => { | |
expect(screen.getByText('some string')).toBeInTheDocument(); | |
}) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment