Skip to content

Commit

Permalink
Merge pull request #375 from arbrandes/fix-route
Browse files Browse the repository at this point in the history
fix: Route with PUBLIC_PATH
  • Loading branch information
arbrandes authored Dec 15, 2023
2 parents a4eff69 + cb65877 commit 7884761
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { AppProvider } from '@edx/frontend-platform/react';
import Footer from '@edx/frontend-component-footer';
import Header from '@edx/frontend-component-header';

import { routePath } from 'data/constants/app';
import store from 'data/store';
import GradebookPage from 'containers/GradebookPage';
import './App.scss';
Expand All @@ -20,7 +19,7 @@ const App = () => (
<main>
<Routes>
<Route
path={routePath}
path="/:courseId"
element={<GradebookPage />}
/>
</Routes>
Expand Down
6 changes: 1 addition & 5 deletions src/App.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { AppProvider } from '@edx/frontend-platform/react';
import Footer from '@edx/frontend-component-footer';
import Header from '@edx/frontend-component-header';

import { routePath } from 'data/constants/app';
import store from 'data/store';
import GradebookPage from 'containers/GradebookPage';

Expand All @@ -21,9 +20,6 @@ jest.mock('react-router-dom', () => ({
jest.mock('@edx/frontend-platform/react', () => ({
AppProvider: () => 'AppProvider',
}));
jest.mock('data/constants/app', () => ({
routePath: '/:courseId',
}));
jest.mock('@edx/frontend-component-footer', () => 'Footer');
jest.mock('data/store', () => 'testStore');
jest.mock('containers/GradebookPage', () => 'GradebookPage');
Expand Down Expand Up @@ -66,7 +62,7 @@ describe('App router component', () => {
expect(secondChild.find('main')).toEqual(shallow(
<main>
<Routes>
<Route path={routePath} element={<GradebookPage />} />
<Route path="/:courseId" element={<GradebookPage />} />
</Routes>
</main>,
));
Expand Down
3 changes: 0 additions & 3 deletions src/data/constants/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { StrictDict } from 'utils';
import { getConfig } from '@edx/frontend-platform';

export const routePath = `${getConfig().PUBLIC_PATH}:courseId`;

export const views = StrictDict({
grades: 'grades',
Expand Down

0 comments on commit 7884761

Please sign in to comment.