diff --git a/src/containers/Dashboard/index.jsx b/src/containers/Dashboard/index.jsx
index 0692e4b..271348c 100644
--- a/src/containers/Dashboard/index.jsx
+++ b/src/containers/Dashboard/index.jsx
@@ -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 && true;
+ const showProductRecommendations = false && !initIsPending && !hasAvailableDashboards && hasCourses;
return (
diff --git a/src/widgets/ProductRecommendations/components/LoadedView.jsx b/src/widgets/ProductRecommendations/components/LoadedView.jsx
index 03aeea0..eb68b5d 100644
--- a/src/widgets/ProductRecommendations/components/LoadedView.jsx
+++ b/src/widgets/ProductRecommendations/components/LoadedView.jsx
@@ -7,19 +7,16 @@ import messages from '../messages';
import { courseShape, courseTypeToProductTypeMap } from '../utils';
import ProductCardContainer from './ProductCardContainer';
-const MAX_OPEN_COURSE_RECOMMENDATIONS = 4;
-const MIN_OPEN_COURSE_RECOMMENDATIONS = 2;
-
const LoadedView = ({ crossProductCourses, openCourses }) => {
const { formatMessage } = useIntl();
const includesCrossProductTypes = crossProductCourses.length === 2;
const finalProductList = useMemo(() => {
if (includesCrossProductTypes) {
- const openCourseList = openCourses ? openCourses.slice(0, MIN_OPEN_COURSE_RECOMMENDATIONS) : [];
+ const openCourseList = openCourses ? openCourses.slice(0, 2) : [];
return crossProductCourses.concat(openCourseList);
}
- return openCourses.slice(0, MAX_OPEN_COURSE_RECOMMENDATIONS);
+ return openCourses;
}, [crossProductCourses, openCourses, includesCrossProductTypes]);
const courseTypes = [...new Set(finalProductList.map((item) => courseTypeToProductTypeMap[item.courseType]))];
diff --git a/src/widgets/ProductRecommendations/components/LoadedView.test.jsx b/src/widgets/ProductRecommendations/components/LoadedView.test.jsx
index 1d57a89..dc6c9fd 100644
--- a/src/widgets/ProductRecommendations/components/LoadedView.test.jsx
+++ b/src/widgets/ProductRecommendations/components/LoadedView.test.jsx
@@ -15,4 +15,20 @@ describe('ProductRecommendations LoadedView', () => {
),
).toMatchSnapshot();
});
+ describe('with less than 2 cross product courses', () => {
+ it('passes in one course type and 4 open courses to the ProductCardContainer props', () => {
+ const wrapper = shallow(
+
,
+ );
+
+ const productCardContainerProps = wrapper.find('ProductCardContainer').props();
+
+ expect(productCardContainerProps.courseTypes.length).toEqual(1);
+ expect(productCardContainerProps.courseTypes[0]).toEqual('Course');
+ expect(productCardContainerProps.finalProductList).toEqual(mockOpenCourses);
+ });
+ });
});
diff --git a/src/widgets/ProductRecommendations/components/ProductCardHeader.test.jsx b/src/widgets/ProductRecommendations/components/ProductCardHeader.test.jsx
index a356950..185230a 100644
--- a/src/widgets/ProductRecommendations/components/ProductCardHeader.test.jsx
+++ b/src/widgets/ProductRecommendations/components/ProductCardHeader.test.jsx
@@ -11,16 +11,19 @@ describe('ProductRecommendations ProductCardHeader', () => {
it('matches snapshot', () => {
expect(shallow(
)).toMatchSnapshot();
});
+ describe('with bootcamp courseType prop', () => {
+ it('renders a bootcamp header', () => {
+ const wrapper = shallow(
);
- it('renders a bootcamp header if the bootcamp course type is passed as a prop', () => {
- const wrapper = shallow(
);
-
- expect(wrapper.find('h3').text()).toEqual(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(
);
+ describe('with course courseType prop', () => {
+ it('renders a courses header', () => {
+ const wrapper = shallow(
);
- expect(wrapper.find('h3').text()).toEqual(courseType);
+ expect(wrapper.find('h3').text()).toEqual(courseType);
+ });
});
});
diff --git a/src/widgets/ProductRecommendations/hooks.test.js b/src/widgets/ProductRecommendations/hooks.test.js
index b2f6659..098f211 100644
--- a/src/widgets/ProductRecommendations/hooks.test.js
+++ b/src/widgets/ProductRecommendations/hooks.test.js
@@ -88,7 +88,7 @@ describe('ProductRecommendations hooks', () => {
cb();
expect(api.fetchProductRecommendations).toHaveBeenCalledWith(mostRecentCourseRunKey);
expect(setRequestState).not.toHaveBeenCalled();
- expect(setData).not.toHaveBeenCalledWith(response.data);
+ expect(setData).not.toHaveBeenCalled();
await resolveFn(response);
expect(setRequestState).toHaveBeenCalledWith(RequestStates.completed);
expect(setData).toHaveBeenCalledWith(response.data);
@@ -103,7 +103,7 @@ describe('ProductRecommendations hooks', () => {
const unMount = cb();
expect(api.fetchProductRecommendations).toHaveBeenCalledWith(mostRecentCourseRunKey);
expect(setRequestState).not.toHaveBeenCalled();
- expect(setData).not.toHaveBeenCalledWith(response.data);
+ expect(setData).not.toHaveBeenCalled();
unMount();
await resolveFn(response);
expect(setRequestState).not.toHaveBeenCalled();