Skip to content

Commit

Permalink
Remove podiatry from type of care list (#32980)
Browse files Browse the repository at this point in the history
* Moves tests

Signed-off-by: Ryan Shaw <[email protected]>

* Tied in vaOnlineSchedulingRemovePodiatry feature flag to selectors and type of care page

Signed-off-by: Ryan Shaw <[email protected]>

* Adds test

Signed-off-by: Ryan Shaw <[email protected]>

* Updated test title to make consistent

Signed-off-by: Ryan Shaw <[email protected]>

* Fixes test

Signed-off-by: Ryan Shaw <[email protected]>

---------

Signed-off-by: Ryan Shaw <[email protected]>
  • Loading branch information
ryanshaw authored Nov 13, 2024
1 parent 8812515 commit 5e1dd7b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default function TypeOfCarePage() {
pageChangeInProgress,
showCommunityCare,
showDirectScheduling,
removePodiatry,
showPodiatryApptUnavailableModal,
} = useSelector(selectTypeOfCarePage, shallowEqual);

Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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(
<Route component={TypeOfCarePage} />,
{ 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({
Expand Down
2 changes: 2 additions & 0 deletions src/applications/vaos/new-appointment/redux/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
selectFeatureDirectScheduling,
selectRegisteredCernerFacilityIds,
selectFeatureVAOSServiceVAAppointments,
selectFeatureRemovePodiatry,
} from '../../redux/selectors';
import { removeDuplicateId } from '../../utils/data';

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5e1dd7b

Please sign in to comment.