Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade user-event to v14 * Address breaking changes in Popover spec - removed the mocked document.createRange. This isn't necessary anymore. See testing-library/user-event#902 - awaited userEvent calls, removed unnecessary act blocks - fixed type errors around icon types - note: there are still act warnings for some tests in the specs, even some not involving any state updates (style snapshots). Probably points to unwanted rerenders. Added a fixme comment. * Address breaking changes in useEscapeKey - exposed the renderHook method from @testing-library/react, meant to replace the onoe from @testing-library/react-hooks, which isn't compatible with React 18. For migration purposes, I'm naming it newRenderHook--I'll remove the legacy method and rename the new one after all specs have been migrated - awaited userEvent calls and removed unnecessary act blocks * Fix accessibility error in ToastContext The live region wrapping toasts should not be a ul, because uls son't allow the status role (likely because it overrides list semantics anyways. Switched for divs. Found through a better axe test * Migrate user-event in NotificationToast spec - await userEvent method calls - added a new render helper to render a component tree including the ToastProvider, to reduce test boilerplate when testing business logic - improved the accesibility test to cover an actual document with a toast instead of the toast UI in isolation * WIP: upgrade user-event in SidePanel components - awaited userEvent methods and removed unnecessary act blocks - migrated useSidePanel to newRenderHook and removed unnecessary actHook blocks - added ariaHideApp=false to default test props in SidePanelContext to silence react-modal warning about the undefined app element - set up userEvent with delay=null in SidePanelContext to address this issue: testing-library/user-event#833 - TODO: two tests using userEvent.keyboard() are still failing. Marked as todo. - TODO: there are two act() warnings left (likely from before) when running `yarn test sidepanel` (all SidePanel-related specs) * Patch keyCode event in SidePanel spec This also adds comments on accessibility tests that inconsistently trigger axe warnings. Will be investigated and addressed separately. * Migrate Button, RadioButton, RadioButtonGroup, Header Awaited userEvent calls. * Migrate remaining input components Checkbox, CurrencyInput, Selector. Awaited userEvent method calls * Migrate notification components Awaited userEvent method calls * Migrate modal components - awaited userEvent method calls - set up userEvent with delay=null in ModalContext spec (same as in SidePanelContext) * Migrate more components Hamburger, Pagination, PageList, UtilityLinks, useClickOutside. Awaited userEvent method calls. Does not include the migration to new renderHook for useClickOutside, will be handled separately. * Use userEvent with delay=null in ToastProvider spec Same as in the ModalProvider and SidePanelProvider * Migrate userEvent in useAutoExpand - awaited method calls - migrated {space} to { } - TODO: migrate to the new renderHook, will be addressed separately * Migrate userEvent in remaining components - await method calls - fix some TS errors * Migrate useStep to renderHook from RTL - replace imports - replace removed waitForNextUpdate by a more explicit waitFor - remove tests covering error logic. Error testing was removed in the renderHook port to RTL and we're not covering this in other components, so I think it's fine to remove. See testing-library/react-testing-library#991 for more context * Migrate renderHook from RHTL to new RTL implementation See testing-library/react-testing-library#991 for context. - replaced import of renderHook to newRenderHook (will be renamed in a follow-up commit) - replaced actHook by act - (edge cases were handled in earlier commits) * Rename newRenderHook to renderHook * Await remaining userEvent promises Not sure why these specs passed locally before * Address review comment
- Loading branch information
Robin Métral
committed
Jun 14, 2022
1 parent
2ac245b
commit 384cedb
Showing
62 changed files
with
609 additions
and
819 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sumup/circuit-ui': patch | ||
--- | ||
|
||
Switched the `ToastContext`'s live region element from a `ul` to a `div`: lists shouldn't have `role="status"` since this strips list semantics. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
384cedb
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.
Successfully deployed to the following URLs:
oss-circuit-ui – ./
circuit.sumup.com
oss-circuit-ui.sumup-vercel.app
oss-circuit-ui-git-main.sumup-vercel.app
circuit-ui.vercel.app