Skip to content
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: upgrade react router to v6 #126

Merged
200 changes: 101 additions & 99 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"dependencies": {
"@edx/brand": "npm:@edx/brand-edx.org@^2.0.3",
"@edx/browserslist-config": "^1.1.0",
"@edx/frontend-component-footer": "^12.0.0",
"@edx/frontend-enterprise-hotjar": "^1.4.0",
"@edx/frontend-platform": "^4.2.0",
"@edx/frontend-component-footer": "^12.2.1",
"@edx/frontend-enterprise-hotjar": "^2.0.0",
"@edx/frontend-platform": "^5.1.0",
"@edx/paragon": "^20.44.0",
"@edx/react-unit-test-utils": "^1.7.0",
"@fortawesome/fontawesome-svg-core": "^1.2.36",
Expand Down Expand Up @@ -65,7 +65,7 @@
"react-intl": "^5.20.9",
"react-pdf": "^5.5.0",
"react-redux": "^7.2.4",
"react-router-dom": "5.3.3",
"react-router-dom": "6.15.0",
"react-share": "^4.4.0",
"react-zendesk": "^0.1.13",
"redux": "4.1.1",
Expand Down
5 changes: 2 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import { Helmet } from 'react-helmet';

import { useIntl } from '@edx/frontend-platform/i18n';
Expand Down Expand Up @@ -74,7 +73,7 @@ export const App = () => {
}
}, [authenticatedUser, loadData]);
return (
<Router>
<>
<Helmet>
<title>{formatMessage(messages.pageTitle)}</title>
</Helmet>
Expand All @@ -97,7 +96,7 @@ export const App = () => {
<Footer logo={process.env.LOGO_POWERED_BY_OPEN_EDX_URL_SVG} />
<ZendeskFab />
</div>
</Router>
</>
);
};

Expand Down
3 changes: 0 additions & 3 deletions src/App.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ describe('App router component', () => {
it('displays learner dashboard header', () => {
expect(el.instance.findByType(LearnerDashboardHeader).length).toEqual(1);
});
it('wraps the page in a browser router', () => {
expect(el.instance.el.type).toEqual('BrowserRouter');
});
test('Footer logo drawn from env variable', () => {
expect(el.instance.findByType(Footer)[0].props.logo).toEqual(logo);
});
Expand Down
12 changes: 6 additions & 6 deletions src/__snapshots__/App.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`App router component component initialize failure snapshot 1`] = `
<BrowserRouter>
<Fragment>
<HelmetWrapper
defer={true}
encodeSpecialCharacters={true}
Expand All @@ -28,11 +28,11 @@ exports[`App router component component initialize failure snapshot 1`] = `
/>
<ZendeskFab />
</div>
</BrowserRouter>
</Fragment>
`;

exports[`App router component component no network failure snapshot 1`] = `
<BrowserRouter>
<Fragment>
<HelmetWrapper
defer={true}
encodeSpecialCharacters={true}
Expand All @@ -55,11 +55,11 @@ exports[`App router component component no network failure snapshot 1`] = `
/>
<ZendeskFab />
</div>
</BrowserRouter>
</Fragment>
`;

exports[`App router component component refresh failure snapshot 1`] = `
<BrowserRouter>
<Fragment>
<HelmetWrapper
defer={true}
encodeSpecialCharacters={true}
Expand All @@ -86,5 +86,5 @@ exports[`App router component component refresh failure snapshot 1`] = `
/>
<ZendeskFab />
</div>
</BrowserRouter>
</Fragment>
`;
Loading