Skip to content

Instantly share code, notes, and snippets.

@becca-bailey
Last active November 15, 2018 03:20
Show Gist options
  • Save becca-bailey/7a9862b84e31e483d5b93bd6c1b80219 to your computer and use it in GitHub Desktop.
Save becca-bailey/7a9862b84e31e483d5b93bd6c1b80219 to your computer and use it in GitHub Desktop.
it("can add an alert", () => {
const TestComponent = () => {
return (
<AlertProvider>
<Layout>
<ComponentWithAlert />
</Layout>
</AlertProvider>
);
};
const { getByText, container } = render(<TestComponent />);
const button = getByText("Show Alert");
fireEvent.click(button);
expect(container.innerHTML).toContain("This is my alert");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment