[Chakra v3 upgrade] @W-18672580 migrate offline components#2684
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
| 'non-pwa/**/*.{js,jsx}', | ||
| 'worker/**/*.{js,jsx}', | ||
| 'scripts/generator/*.{js,jsx}', | ||
| 'src/**/*.{js,jsx}', |
There was a problem hiding this comment.
add unit test coverage report for extension-chakra-storefront folder
| import {useIntl} from 'react-intl' | ||
|
|
||
| // Components | ||
| import {Alert, AlertDescription, Flex} from '@chakra-ui/react' |
There was a problem hiding this comment.
In chakra v3, everything imported from Alert alone, AlertDescription is not needed anymore
| @@ -68,23 +68,13 @@ class OfflineBoundary extends React.Component { | |||
| return ( | |||
| <React.Fragment> | |||
There was a problem hiding this comment.
Every component in offline-boundary is v3 compatible already.
Removed legacy classnames
packages/extension-chakra-storefront/src/components/offline-boundary/index.test.js
Outdated
Show resolved
Hide resolved
packages/extension-chakra-storefront/src/components/offline-boundary/index.test.js
Outdated
Show resolved
Hide resolved
packages/extension-chakra-storefront/src/components/offline-boundary/index.jsx
Outdated
Show resolved
Hide resolved
packages/extension-chakra-storefront/src/components/offline-boundary/index.jsx
Outdated
Show resolved
Hide resolved
packages/extension-chakra-storefront/src/components/offline-boundary/index.jsx
Outdated
Show resolved
Hide resolved
packages/extension-chakra-storefront/src/components/offline-boundary/index.jsx
Outdated
Show resolved
Hide resolved
|
|
||
| test('should render its children', () => { | ||
| renderWithRouter( | ||
| renderWithRouterAndChakra( |
There was a problem hiding this comment.
Why cant we use renderWithProviders?
There was a problem hiding this comment.
In offline-boundary's index.jsx I saw
export default withRouter(OfflineBoundary)
From my understanding, with withRouter, the error boundary becomes "route-aware", in which normal renderWithProviders wouldn't be able to cover this use case. So use renderWithRouter for this special component
…om v2 to v3 (#2684) * update: migrate offline components from v2 to v3 * add unit test coverage report & cleanup * class name clean up * use renderWithRouter to test offline-boundary * use newer chakra UI component instead of basic html tags * wrap user.click with act * clean up comments
Description
Migrate offline-banner & offline-boundary components to Chakra v3

Staging v2:
Local v3:

Unit test coverage:

Types of Changes
How to Test-Drive This PR
npm startIn staging env, https://pwa-kit.mobify-storefront.com/, everything works in Chakra v2.
For offline components, we could show them on purpose in staging env following:
No throttlingtoOfflineChecklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization