Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove podiatry from type of care list #32980

Merged
merged 7 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
pageChangeInProgress,
showCommunityCare,
showDirectScheduling,
removePodiatry,
showPodiatryApptUnavailableModal,
} = useSelector(selectTypeOfCarePage, shallowEqual);

Expand Down Expand Up @@ -64,13 +65,15 @@

dispatch(startDirectScheduleFlow({ isRecordEvent: false }));
},
[showUpdateAddressAlert, dispatch],

Check warning on line 68 in src/applications/vaos/new-appointment/components/TypeOfCarePage/index.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/vaos/new-appointment/components/TypeOfCarePage/index.jsx:68:5:React Hook useEffect has a missing dependency: 'pageTitle'. Either include it or remove the dependency array.
);

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),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like the removePodiatry variable name here as all of the other variables are showSomething but wanted to keep it consistent with what the feature flag was originally named.

).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 @@ -8,17 +8,21 @@
import set from 'platform/utilities/data/set';
import { mockFetch, setFetchJSONResponse } from 'platform/testing/unit/helpers';

import moment from 'moment';

Check warning on line 11 in src/applications/vaos/new-appointment/components/TypeOfCarePage/index.unit.spec.js

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/vaos/new-appointment/components/TypeOfCarePage/index.unit.spec.js:11:1:Use date-fns or Native Date methods instead of moment.js
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 @@
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),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like the removePodiatry variable name here as all of the other variables are showSomething but wanted to keep it consistent with what the feature flag was originally named.

showPodiatryApptUnavailableModal:
newAppointment.showPodiatryAppointmentUnavailableModal,
useV2: featureVAOSServiceVAAppointments,
Expand Down
Loading