diff --git a/src/skills-builder/skills-builder-modal/view-results/RecommendationStack.jsx b/src/skills-builder/skills-builder-modal/view-results/RecommendationStack.jsx index deb9cfb..82b356b 100644 --- a/src/skills-builder/skills-builder-modal/view-results/RecommendationStack.jsx +++ b/src/skills-builder/skills-builder-modal/view-results/RecommendationStack.jsx @@ -90,6 +90,9 @@ const RecommendationStack = ({ selectedRecommendations, productTypeNames }) => { const numberResults = productTypeRecommendations?.length; const isExpanded = expandedList.includes(productTypeName); + if (numberResults === 0) { + return null; + } return ( { expect(screen.getByText(messages.productTypeProgramDescription.defaultMessage)).toBeTruthy(); expect(screen.getByText(messages.productTypeCourseDescription.defaultMessage)).toBeTruthy(); }); + + it('hides a LOB if there are no results', async () => { + getProductRecommendations.mockImplementation((productIndex, productType) => { + if (productType === 'boot_camp') { + return mockData.productRecommendations; + } + return []; + }); + + // This one should not be true - no recommendations provided + expect(screen.getByText(messages.productTypeBootCampDescription.defaultMessage)).toBeFalsy(); + // These should all work. + expect(screen.getByText(messages.productTypeDegreeDescription.defaultMessage)).toBeTruthy(); + expect(screen.getByText(messages.productTypeExecutiveEducationDescription.defaultMessage)).toBeTruthy(); + expect(screen.getByText(messages.productTypeProgramDescription.defaultMessage)).toBeTruthy(); + expect(screen.getByText(messages.productTypeCourseDescription.defaultMessage)).toBeTruthy(); + }); }); describe('show all button', () => {