From 648b55e97e977443933da7d4cd4904dd7468568e Mon Sep 17 00:00:00 2001 From: Ejaz Ahmad <86868918+jajjibhai008@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:00:48 +0500 Subject: [PATCH] feat: integrate new pathway section in academy detail page (#1068) --- .../academies/AcademyContentCard.jsx | 61 ++++---------- .../academies/AcademyDetailPage.jsx | 71 +++++++++------- src/components/academies/PathwaysSection.jsx | 83 ++++++++++++++----- src/components/academies/data/hooks.js | 37 +++++++++ .../academies/data/tests/hooks.test.js | 74 ++++++++++++++++- .../tests/AcademyDetailPage.test.jsx | 15 ++++ .../academies/tests/PathwaysSection.test.jsx | 43 +++++++++- src/components/app/data/utils.js | 9 ++ 8 files changed, 291 insertions(+), 102 deletions(-) diff --git a/src/components/academies/AcademyContentCard.jsx b/src/components/academies/AcademyContentCard.jsx index 7accf36a6..7e63efef7 100644 --- a/src/components/academies/AcademyContentCard.jsx +++ b/src/components/academies/AcademyContentCard.jsx @@ -8,9 +8,8 @@ import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n'; import { camelCaseObject } from '@edx/frontend-platform/utils'; import { v4 as uuidv4 } from 'uuid'; import PropTypes from 'prop-types'; -import { LEARNING_TYPE_COURSE, LEARNING_TYPE_EXECUTIVE_EDUCATION, LEARNING_TYPE_PATHWAY } from '@edx/frontend-enterprise-catalog-search/data/constants'; +import { LEARNING_TYPE_COURSE, LEARNING_TYPE_EXECUTIVE_EDUCATION } from '@edx/frontend-enterprise-catalog-search/data/constants'; import SearchCourseCard from '../search/SearchCourseCard'; -import SearchPathwayCard from '../pathway/SearchPathwayCard'; import { useEnterpriseCustomer } from '../app/data'; const AcademyContentCard = ({ @@ -26,7 +25,6 @@ const AcademyContentCard = ({ const intl = useIntl(); const ocmCourses = []; const execEdCourses = []; - const pathways = []; const maxCoursesToShow = 4; useEffect( @@ -66,8 +64,6 @@ const AcademyContentCard = ({ ocmCourses.push(course); } else if (course.learningType === LEARNING_TYPE_EXECUTIVE_EDUCATION) { execEdCourses.push(course); - } else if (course.learningType === LEARNING_TYPE_PATHWAY) { - pathways.push(course); } }); @@ -131,7 +127,7 @@ const AcademyContentCard = ({
-
+
Pathway
-Lead with AI. This pathway will introduce you to basics of AI, as well as cover core - concepts for how to use and apply AI responsibly to support the strategy and growth - of your business. -
-
+
Pathway overview
', +}; +const mockEnterpriseCustomer = enterpriseCustomerFactory(); describe('PathwaysSection', () => { it('renders pathway title and description correctly', () => { - render(