diff --git a/src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/TypeOfAppointmentSection.jsx b/src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/TypeOfAppointmentSection.jsx index e07e50ba3d4e..43c831cbb306 100644 --- a/src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/TypeOfAppointmentSection.jsx +++ b/src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/TypeOfAppointmentSection.jsx @@ -1,34 +1,17 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { FLOW_TYPES } from '../../../../utils/constants'; +import { sentenceCase } from '../../../../utils/formatters'; import { getTypeOfCare } from '../../../redux/selectors'; -export default function TypeOfAppointmentSection({ data, flowType }) { - const typeOfCare = getTypeOfCare(data)?.name; - - let typeOfAppt = 'VA Appointment'; - - if (FLOW_TYPES.REQUEST === flowType) { - typeOfAppt = 'Type of care'; - - return ( - <> -

- {typeOfAppt} -

- - {typeOfCare} - - - ); - } +export default function TypeOfAppointmentSection({ data }) { + const typeOfCare = sentenceCase(getTypeOfCare(data)?.name); return ( <>

- {typeOfAppt} + Type of care

- + {typeOfCare} diff --git a/src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/index.jsx b/src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/index.jsx index 4ebd2fae3c59..3390ca644560 100644 --- a/src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/index.jsx +++ b/src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/index.jsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { FACILITY_TYPES, FLOW_TYPES } from '../../../../utils/constants'; +import { FACILITY_TYPES } from '../../../../utils/constants'; import TypeOfAppointmentSection from './TypeOfAppointmentSection'; import VAAppointmentSection from './VAAppointmentSection'; import CommunityCareSection from './CommunityCareSection/CommunityCareSection'; @@ -17,7 +17,7 @@ export default function ReviewRequestInfo({ return (

{pageTitle}

- + {isCommunityCare && ( { store, }); - await screen.findByText(/scheduling a primary care appointment/i); + await screen.findByText('Primary care'); expect(screen.getByText('Primary care')).to.have.tagName('span'); const [ pageHeading, - descHeading, typeOfCareHeading, dateHeading, clinicHeading, @@ -130,10 +129,7 @@ describe('VAOS Page: ReviewPage direct scheduling with v2 api', () => { expect(pageHeading).to.contain.text( 'Review and confirm your appointment details', ); - expect(descHeading).to.contain.text( - 'scheduling a primary care appointment', - ); - expect(typeOfCareHeading).to.contain.text('VA Appointment'); + expect(typeOfCareHeading).to.contain.text('Type of care'); expect(screen.baseElement).to.contain.text('Primary care'); expect(dateHeading).to.contain.text( @@ -174,7 +170,7 @@ describe('VAOS Page: ReviewPage direct scheduling with v2 api', () => { store, }); - await screen.findByText(/scheduling a primary care appointment/i); + await screen.findByText('Primary care'); userEvent.click(screen.getByText(/Confirm appointment/i)); await waitFor(() => { @@ -216,7 +212,7 @@ describe('VAOS Page: ReviewPage direct scheduling with v2 api', () => { store, }); - await screen.findByText(/scheduling a primary care appointment/i); + await screen.findByText('Primary care'); userEvent.click(screen.getByText(/Confirm appointment/i)); @@ -261,7 +257,7 @@ describe('VAOS Page: ReviewPage direct scheduling with v2 api', () => { store, }); - await screen.findByText(/scheduling a primary care appointment/i); + await screen.findByText('Primary care'); userEvent.click(screen.getByText(/Confirm appointment/i)); @@ -300,7 +296,7 @@ describe('VAOS Page: ReviewPage direct scheduling with v2 api', () => { store, }); - await screen.findByText(/scheduling a primary care appointment/i); + await screen.findByText('Primary care'); userEvent.click(screen.getByText(/Confirm appointment/i)); @@ -339,7 +335,7 @@ describe('VAOS Page: ReviewPage direct scheduling with v2 api', () => { store, }); - await screen.findByText(/scheduling a primary care appointment/i); + await screen.findByText('Primary care'); userEvent.click(screen.getByText(/Confirm appointment/i));