Skip to content

Instantly share code, notes, and snippets.

@itaditya
Last active October 3, 2020 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itaditya/ea170c593331a715a2dd0b0d5dabe630 to your computer and use it in GitHub Desktop.
Save itaditya/ea170c593331a715a2dd0b0d5dabe630 to your computer and use it in GitHub Desktop.
(Blog) Testing a Redux hooked app
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