Created
November 19, 2024 00:03
-
-
Save nedgrady/fd685656d697ca4e87f9bd7da33068ea 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
test("When the 'cancel' button is clicked, onClose is called", () => { | |
render( | |
<CustomModal | |
onClose={reason => { | |
expect(reason).toBe("clicked cancel") | |
}} | |
/>, | |
) | |
const button = screen.getByRole("button", { name: /Cancel/i }) | |
userEvent.click(button) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment