-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(react): support react 17 #1680
base: develop
Are you sure you want to change the base?
Conversation
ff1b1e5
to
84b23af
Compare
This pull request is automatically being deployed by Amplify Hosting (learn more). |
@@ -545,6 +548,9 @@ test('should not prevent default with enter keypress and closed listbox', () => | |||
// rtl doesn't let us mock preventDefault | |||
// see: https://github.com/testing-library/react-testing-library/issues/572 | |||
event.preventDefault = preventDefault; | |||
if (type === 'focus') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From Jason:
The changes here I suspect are related to testing-library/user-event#592, but we're not using user-event but are calling fireEvent due to specific limitations with testing library.
expect(outsideButton).toBeTruthy(); | ||
await user.click(outsideButton); | ||
render(<Wrapper tooltipProps={{ onClose }} />); | ||
await user.click(document.body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to add any other elements to test clicking outside. We can click on the body
element instead.
buttonProps = {}, | ||
tooltipProps = {} | ||
}: { | ||
interface PopoverProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small cleanup since these types were repeated.
await waitFor(() => expect(handleClose).toHaveBeenCalledTimes(1)); | ||
}); | ||
|
||
test('close opened popover when clicking on the popover trigger button', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test verifies that the popover content is not in the document once the popover button is clicked. It's failing so we know it's a bug. I originally went with the handleClose
check but that passed since it's being called twice. This is closer to what a user sees to know that the content is not there.
closes #1473
The
Modal
component works fine with the Cauldron 17 upgrade.modal-component.mov
TODO: