Skip to content

Commit

Permalink
test: added a unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
AfaqShuaib09 committed Nov 1, 2024
1 parent 9868cda commit 4cca100
Show file tree
Hide file tree
Showing 2 changed files with 605 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/EditCoursePage/CollapsibleCourseRun.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const publishedCourseRun = {
};

const unpublishedCourseRun = { ...publishedCourseRun, status: 'unpublished' };
const inReviewCourseRun = { ...publishedCourseRun, status: 'review_by_internal' };

const currentFormValues = {
course_runs: [publishedCourseRun, unpublishedCourseRun],
Expand Down Expand Up @@ -96,6 +97,18 @@ describe('Collapsible Course Run', () => {
expect(shallowToJson(component)).toMatchSnapshot();
});

it('renders correctly when given a course run in review', () => {
const component = shallow(<CollapsibleCourseRun
languageOptions={languageOptions}
pacingTypeOptions={pacingTypeOptions}
courseRun={inReviewCourseRun}
courseId="test-course"
courseUuid="11111111-1111-1111-1111-111111111111"
index={2}
/>);
expect(shallowToJson(component)).toMatchSnapshot();
});

it('renders correctly with a course run type', () => {
const component = shallow(<CollapsibleCourseRun
languageOptions={languageOptions}
Expand Down
Loading

0 comments on commit 4cca100

Please sign in to comment.