test: additional product card header tests
This commit is contained in:
@@ -24,7 +24,7 @@ export const Dashboard = () => {
|
||||
const showSelectSessionModal = reduxHooks.useShowSelectSessionModal();
|
||||
|
||||
// Hard coded to not show until experiment set-up logic is implemented
|
||||
const showProductRecommendations = !initIsPending && !hasAvailableDashboards && hasCourses && false;
|
||||
const showProductRecommendations = !initIsPending && !hasAvailableDashboards && hasCourses && true;
|
||||
|
||||
return (
|
||||
<div id="dashboard-container" className="d-flex flex-column p-2 pt-0">
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import { mockCrossProductCourses } from '../testData';
|
||||
import ProductCardHeader from './ProductCardHeader';
|
||||
import { courseTypeToProductTypeMap } from '../utils';
|
||||
|
||||
describe('ProductRecommendations ProductCardHeader', () => {
|
||||
const course = mockCrossProductCourses[0];
|
||||
const bootCampType = 'Boot Camp';
|
||||
const executiveEducationType = 'Executive Education';
|
||||
const courseType = 'Courses';
|
||||
|
||||
it('matches snapshot', () => {
|
||||
expect(shallow(<ProductCardHeader courseType={courseTypeToProductTypeMap[course.courseType]} />)).toMatchSnapshot();
|
||||
expect(shallow(<ProductCardHeader courseType={executiveEducationType} />)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders a bootcamp header if the bootcamp course type is passed as a prop', () => {
|
||||
const wrapper = shallow(<ProductCardHeader courseType={bootCampType} />);
|
||||
|
||||
expect(wrapper.find('h3').text()).toEqual(bootCampType);
|
||||
});
|
||||
|
||||
it('renders a courses header if the courses course type is passed as a prop', () => {
|
||||
const wrapper = shallow(<ProductCardHeader courseType={courseType} />);
|
||||
|
||||
expect(wrapper.find('h3').text()).toEqual(courseType);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const getCoursesWithType = (courseTypes) => {
|
||||
export const getCoursesWithType = (courseTypes) => {
|
||||
const courses = [];
|
||||
|
||||
courseTypes.forEach((type) => {
|
||||
|
||||
Reference in New Issue
Block a user