Created
May 11, 2021 12:29
-
-
Save bengrunfeld/0f9c5010429b641df3b1159d033f131c to your computer and use it in GitHub Desktop.
React Testing Library - findBy
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 { render, screen } from '@testing-library/react' | |
import { App } from './App' | |
test('Render the App component', () => { | |
render(<App />) | |
expect(screen.queryByText('Log In')).toBeNull() | |
expect(screen.findByText('Log In')).toBeInTheDocument() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment