diff --git a/src/applications/vaos/new-appointment/components/TypeOfCarePage/index.jsx b/src/applications/vaos/new-appointment/components/TypeOfCarePage/index.jsx index 5f8f396c6b6c..d1927b8db8fa 100644 --- a/src/applications/vaos/new-appointment/components/TypeOfCarePage/index.jsx +++ b/src/applications/vaos/new-appointment/components/TypeOfCarePage/index.jsx @@ -37,6 +37,7 @@ export default function TypeOfCarePage() { pageChangeInProgress, showCommunityCare, showDirectScheduling, + removePodiatry, showPodiatryApptUnavailableModal, } = useSelector(selectTypeOfCarePage, shallowEqual); @@ -70,7 +71,9 @@ export default function TypeOfCarePage() { const { data, schema, setData, uiSchema } = useFormState({ initialSchema: () => { const sortedCare = TYPES_OF_CARE.filter( - typeOfCare => typeOfCare.id !== PODIATRY_ID || showCommunityCare, + typeOfCare => + typeOfCare.id !== PODIATRY_ID || + (showCommunityCare && !removePodiatry), ).sort( (careA, careB) => careA.name.toLowerCase() > careB.name.toLowerCase() ? 1 : -1, diff --git a/src/applications/vaos/tests/new-appointment/components/TypeOfCarePage.unit.spec.js b/src/applications/vaos/new-appointment/components/TypeOfCarePage/index.unit.spec.js similarity index 93% rename from src/applications/vaos/tests/new-appointment/components/TypeOfCarePage.unit.spec.js rename to src/applications/vaos/new-appointment/components/TypeOfCarePage/index.unit.spec.js index 56c1a71de6dd..9b1e6ada9188 100644 --- a/src/applications/vaos/tests/new-appointment/components/TypeOfCarePage.unit.spec.js +++ b/src/applications/vaos/new-appointment/components/TypeOfCarePage/index.unit.spec.js @@ -10,15 +10,19 @@ import { mockFetch, setFetchJSONResponse } from 'platform/testing/unit/helpers'; import moment from 'moment'; import environment from '@department-of-veterans-affairs/platform-utilities/environment'; -import { createTestStore, renderWithStoreAndRouter } from '../../mocks/setup'; + +import TypeOfCarePage from './index'; +import { + createTestStore, + renderWithStoreAndRouter, +} from '../../../tests/mocks/setup'; import { mockVAOSParentSites, mockV2CommunityCareEligibility, -} from '../../mocks/helpers'; +} from '../../../tests/mocks/helpers'; -import TypeOfCarePage from '../../../new-appointment/components/TypeOfCarePage'; -import { NewAppointment } from '../../../new-appointment'; -import { createMockFacility } from '../../mocks/data'; +import { NewAppointment } from '../..'; +import { createMockFacility } from '../../../tests/mocks/data'; import { FLOW_TYPES } from '../../../utils/constants'; const initialState = { @@ -196,6 +200,23 @@ describe('VAOS Page: TypeOfCarePage', () => { expect((await screen.findAllByRole('radio')).length).to.equal(11); }); + it('should show type of care page without podiatry when vaOnlineSchedulingRemovePodiatry feature flag is on and CC flag is on', async () => { + const store = createTestStore({ + ...initialState, + featureToggles: { + ...initialState.featureToggles, + vaOnlineSchedulingCommunityCare: true, + vaOnlineSchedulingRemovePodiatry: true, + }, + }); + const screen = renderWithStoreAndRouter( + , + { store }, + ); + + expect((await screen.findAllByRole('radio')).length).to.equal(11); + }); + it('should not allow users who are not CC eligible to use Podiatry', async () => { const store = createTestStore(initialState); mockV2CommunityCareEligibility({ diff --git a/src/applications/vaos/new-appointment/redux/selectors.js b/src/applications/vaos/new-appointment/redux/selectors.js index 85d51fbd42f5..ad0edc4b3da2 100644 --- a/src/applications/vaos/new-appointment/redux/selectors.js +++ b/src/applications/vaos/new-appointment/redux/selectors.js @@ -20,6 +20,7 @@ import { selectFeatureDirectScheduling, selectRegisteredCernerFacilityIds, selectFeatureVAOSServiceVAAppointments, + selectFeatureRemovePodiatry, } from '../../redux/selectors'; import { removeDuplicateId } from '../../utils/data'; @@ -373,6 +374,7 @@ export function selectTypeOfCarePage(state) { pageChangeInProgress: selectPageChangeInProgress(state), showCommunityCare: selectFeatureCommunityCare(state), showDirectScheduling: selectFeatureDirectScheduling(state), + removePodiatry: selectFeatureRemovePodiatry(state), showPodiatryApptUnavailableModal: newAppointment.showPodiatryAppointmentUnavailableModal, useV2: featureVAOSServiceVAAppointments,