Skip to content

Commit

Permalink
feat: remove old/duplicate proctoring component (openedx#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharis278 authored Nov 9, 2023
1 parent 78eb512 commit 7c7b3cd
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 1,619 deletions.
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ Developing

If your devstack includes the default Demo course, you can visit the following URLs to see content:

- `Proctored Exam Settings <http://localhost:2001/course/course-v1:edX+DemoX+Demo_Course/proctored-exam-settings>`_
- `Pages and Resources <http://localhost:2001/course/course-v1:edX+DemoX+Demo_Course/pages-and-resources>`_

Troubleshooting
Expand Down
7 changes: 4 additions & 3 deletions src/CourseAuthoringRoutes.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import { Routes, Route, useParams } from 'react-router-dom';
import {
Navigate, Routes, Route, useParams,
} from 'react-router-dom';
import { PageWrap } from '@edx/frontend-platform/react';
import Placeholder from '@edx/frontend-lib-content-components';
import CourseAuthoringPage from './CourseAuthoringPage';
import { PagesAndResources } from './pages-and-resources';
import ProctoredExamSettings from './proctored-exam-settings/ProctoredExamSettings';
import EditorContainer from './editors/EditorContainer';
import VideoSelectorContainer from './selectors/VideoSelectorContainer';
import CustomPages from './custom-pages';
Expand Down Expand Up @@ -61,7 +62,7 @@ const CourseAuthoringRoutes = () => {
/>
<Route
path="proctored-exam-settings"
element={<PageWrap><ProctoredExamSettings courseId={courseId} /></PageWrap>}
element={<Navigate replace to={`/course/${courseId}/pages-and-resources`} />}
/>
<Route
path="custom-pages/*"
Expand Down
24 changes: 0 additions & 24 deletions src/CourseAuthoringRoutes.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import initializeStore from './store';

const courseId = 'course-v1:edX+TestX+Test_Course';
const pagesAndResourcesMockText = 'Pages And Resources';
const proctoredExamSeetingsMockText = 'Proctored Exam Settings';
const editorContainerMockText = 'Editor Container';
const videoSelectorContainerMockText = 'Video Selector Container';
const customPagesMockText = 'Custom Pages';
Expand Down Expand Up @@ -36,10 +35,6 @@ jest.mock('./pages-and-resources/PagesAndResources', () => (props) => {
mockComponentFn(props);
return pagesAndResourcesMockText;
});
jest.mock('./proctored-exam-settings/ProctoredExamSettings', () => (props) => {
mockComponentFn(props);
return proctoredExamSeetingsMockText;
});
jest.mock('./editors/EditorContainer', () => (props) => {
mockComponentFn(props);
return editorContainerMockText;
Expand Down Expand Up @@ -76,25 +71,6 @@ describe('<CourseAuthoringRoutes>', () => {
);

expect(screen.getByText(pagesAndResourcesMockText)).toBeVisible();
expect(screen.queryByText(proctoredExamSeetingsMockText)).not.toBeInTheDocument();
expect(mockComponentFn).toHaveBeenCalledWith(
expect.objectContaining({
courseId,
}),
);
});

it('renders the ProctoredExamSettings component when the proctored exam settings route is active', () => {
render(
<AppProvider store={store} wrapWithRouter={false}>
<MemoryRouter initialEntries={['/proctored-exam-settings']}>
<CourseAuthoringRoutes />
</MemoryRouter>
</AppProvider>,
);

expect(screen.queryByText(proctoredExamSeetingsMockText)).toBeInTheDocument();
expect(screen.queryByText(pagesAndResourcesMockText)).not.toBeInTheDocument();
expect(mockComponentFn).toHaveBeenCalledWith(
expect.objectContaining({
courseId,
Expand Down
1 change: 0 additions & 1 deletion src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
@import "assets/scss/form";
@import "assets/scss/utilities";
@import "assets/scss/animations";
@import "proctored-exam-settings/proctoredExamSettings";
@import "pages-and-resources/discussions/app-list/AppList";
@import "advanced-settings/scss/AdvancedSettings";
@import "grading-settings/scss/GradingSettings";
Expand Down
2 changes: 1 addition & 1 deletion src/pages-and-resources/proctoring/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const ProctoringSettings = ({ intl, onClose }) => {
);
}

const learnMoreLink = appInfo.documentationLinks?.learnMoreConfiguration && (
const learnMoreLink = appInfo?.documentationLinks?.learnMoreConfiguration && (
<Hyperlink
className="text-primary-500"
destination={appInfo.documentationLinks.learnMoreConfiguration}
Expand Down
Loading

0 comments on commit 7c7b3cd

Please sign in to comment.