Last active
November 15, 2018 03:20
-
-
Save becca-bailey/7a9862b84e31e483d5b93bd6c1b80219 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
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