Last active
October 3, 2020 12:53
-
-
Save itaditya/ea170c593331a715a2dd0b0d5dabe630 to your computer and use it in GitHub Desktop.
(Blog) Testing a Redux hooked app
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
test('only show veg food when veg filter is applied', () => { | |
// arrange | |
render(<App {...props} />); | |
// act | |
fireEvent.click(screen.getByRole('checkbox', { name: /Veg Only/i })); | |
// assert | |
expect(screen.queryByText(/Sausage McMuffin/i)).toBe(null); | |
expect(screen.getByText(/Mushroom Pizza/i)).toBeInTheDocument(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment