diff --git a/src/components/EnterpriseApp/index.jsx b/src/components/EnterpriseApp/index.jsx index 5de30bdb6..4b269d732 100644 --- a/src/components/EnterpriseApp/index.jsx +++ b/src/components/EnterpriseApp/index.jsx @@ -214,7 +214,6 @@ EnterpriseApp.propTypes = { enableAnalyticsScreen: PropTypes.bool, enableReportingConfigurationsScreen: PropTypes.bool, enablePortalLearnerCreditManagementScreen: PropTypes.bool, - enterpriseGroupsV2: PropTypes.bool, error: PropTypes.instanceOf(Error), loading: PropTypes.bool, }; diff --git a/src/components/PeopleManagement/index.jsx b/src/components/PeopleManagement/index.jsx index 8014c27c0..1ad9b86f9 100644 --- a/src/components/PeopleManagement/index.jsx +++ b/src/components/PeopleManagement/index.jsx @@ -2,9 +2,9 @@ import React, { useContext } from 'react'; import { Helmet } from 'react-helmet'; import { useIntl, FormattedMessage } from '@edx/frontend-platform/i18n'; import { - ActionRow, Button, Card, Icon, IconButtonWithTooltip, useToggle, + ActionRow, Button, Card, useToggle, } from '@openedx/paragon'; -import { Add, InfoOutline } from '@openedx/paragon/icons'; +import { Add } from '@openedx/paragon/icons'; import cardImage from './images/ZeroStateImage.svg'; import Hero from '../Hero'; @@ -19,30 +19,21 @@ const PeopleManagementPage = () => { description: 'Title for the people management page.', }); - const { - enterpriseSubsidyTypes, - } = useContext(EnterpriseSubsidiesContext); + const { enterpriseSubsidyTypes } = useContext(EnterpriseSubsidiesContext); - const hasLearnerCredit = enterpriseSubsidyTypes.includes(SUBSIDY_TYPES.budget); + const hasLearnerCredit = enterpriseSubsidyTypes.includes( + SUBSIDY_TYPES.budget, + ); const hasOtherSubsidyTypes = enterpriseSubsidyTypes.includes(SUBSIDY_TYPES.license) || enterpriseSubsidyTypes.includes(SUBSIDY_TYPES.coupon); // eslint-disable-next-line @typescript-eslint/no-unused-vars const [isModalOpen, openModal, closeModal] = useToggle(false); - const tooltipContent = ( - - ); - return ( <> - {hasLearnerCredit && (
@@ -50,29 +41,25 @@ const PeopleManagementPage = () => {

- {hasLearnerCredit && hasOtherSubsidyTypes && ( - {}} - variant="primary" - className="ml-1" - /> - )}
- + {hasLearnerCredit && ( + + )} + {!hasLearnerCredit && hasOtherSubsidyTypes && ( + + )}
- )} ); }; diff --git a/src/components/PeopleManagement/tests/PeopleManagementPage.test.jsx b/src/components/PeopleManagement/tests/PeopleManagementPage.test.jsx index f8a5d33a8..0da02bee9 100644 --- a/src/components/PeopleManagement/tests/PeopleManagementPage.test.jsx +++ b/src/components/PeopleManagement/tests/PeopleManagementPage.test.jsx @@ -1,6 +1,4 @@ -import { - render, screen, -} from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom/extend-expect'; import thunk from 'redux-thunk'; import configureMockStore from 'redux-mock-store'; @@ -11,7 +9,7 @@ import { EnterpriseSubsidiesContext } from '../../EnterpriseSubsidiesContext'; import PeopleManagementPage from '..'; const mockStore = configureMockStore([thunk]); -const getMockStore = store => mockStore(store); +const getMockStore = (store) => mockStore(store); const enterpriseSlug = 'test-enterprise'; const enterpriseUUID = '1234'; const initialStoreState = { @@ -23,7 +21,12 @@ const initialStoreState = { }; const defaultEnterpriseSubsidiesContextValue = { - enterpriseSubsidyTypes: ['budget', 'license'], + enterpriseSubsidyTypes: ['budget'], + isLoading: false, +}; + +const subsEnterpriseSubsidiesContextValue = { + enterpriseSubsidyTypes: ['license'], isLoading: false, }; @@ -46,9 +49,27 @@ const PeopleManagementPageWrapper = ({ describe('', () => { it('renders the PeopleManagementPage zero state', () => { render(); + expect(document.querySelector('h3').textContent).toEqual("Your organization's groups"); + expect(screen.getByText("You don't have any groups yet.")).toBeInTheDocument(); + expect(screen.getByText( + 'Monitor group learning progress, assign more courses, and invite members to new Learner Credit budgets.', + )).toBeInTheDocument(); + }); + it('renders the PeopleManagementPage zero state without LC', () => { + const store = getMockStore(initialStoreState); + render( + + + + + + + , + ); expect(document.querySelector('h3').textContent).toEqual( - 'Your Learner Credit groups', + "Your organization's groups", ); - expect(screen.getByText('You don\'t have any groups yet.')).toBeInTheDocument(); + expect(screen.getByText("You don't have any groups yet.")).toBeInTheDocument(); + expect(screen.getByText("Once a group is created, you can track members' progress.")).toBeInTheDocument(); }); });