Skip to content

Commit

Permalink
update content (#33522)
Browse files Browse the repository at this point in the history
Co-authored-by: Tony Williams <vbahinwillit@gmai.com>
  • Loading branch information
vbahinwillit and Tony Williams authored Dec 12, 2024
1 parent 703d70f commit 06b21f7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ describe('VAOS Page: VAFacilityPage eligibility check', () => {
screen.queryByText(/San Diego VA Medical Center/i);
});
expect(screen.baseElement).to.contain.text(
'You can’t request another appointment until you schedule or cancel your open requests',
'You’ll need to call to schedule at this facility',
);

expect(await screen.queryByText(/Continue/)).not.to.exist;
Expand Down Expand Up @@ -583,7 +583,7 @@ describe('VAOS Page: VAFacilityPage eligibility check', () => {
.exist;
});

it('should show request limit message and link to the requested appointments, when current appt is over the request limit', async () => {
it('should show request limit message when current appt is over the request limit', async () => {
// Given the user is requesting an appointment
mockSchedulingConfigurations([
getSchedulingConfigurationMock({
Expand Down Expand Up @@ -630,11 +630,9 @@ describe('VAOS Page: VAFacilityPage eligibility check', () => {
// Then they are presented with the message that they are over the request limit
await screen.findByTestId('eligibilityModal');

// And the link in the over the limit message takes the user to the pending appt page
expect(screen.getByTestId('appointment-list-link')).to.exist;
expect(
screen.getByTestId('appointment-list-link').getAttribute('href'),
).to.equal('/my-health/appointments/pending');
screen.getByText(/You’ll need to call to schedule at this facility/i),
).to.exist;
});

it('should show past visits message when not eligible for direct, requests are supported, no past visit', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import PropTypes from 'prop-types';
import React from 'react';
import { VaTelephone } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import FacilityAddress from '../../../components/FacilityAddress';
import { ELIGIBILITY_REASONS } from '../../../utils/constants';

export default function getEligibilityMessage({
eligibility,
facilityDetails,
includeFacilityContactInfo = false,
}) {
let content = null;
let title = null;
Expand Down Expand Up @@ -86,32 +84,25 @@ export default function getEligibilityMessage({
</>
);
} else if (requestReason === ELIGIBILITY_REASONS.overRequestLimit) {
title = 'You’ve reached the limit for appointment requests';
title = 'You can’t schedule this appointment online';
const contact = facilityDetails?.telecom?.find(
tele => tele.system === 'phone',
)?.value;

content = (
<>
<p>You’ll need to call to schedule at this facility.</p>
<p>
Our records show that you have an open appointment request at this
location. You can’t request another appointment until you schedule or
cancel your open requests.
</p>
<p>
Call this facility to schedule or cancel an open appointment request.
You can also cancel a request from{' '}
<va-link
href="/my-health/appointments/pending"
text="your appointment list"
data-testid="appointment-list-link"
/>
.
<strong>{facilityDetails.name}</strong>
<br />
<strong>Main phone: </strong>
<VaTelephone contact={contact} />
<span>
&nbsp;(
<VaTelephone contact="711" tty data-testid="tty-telephone" />)
</span>
</p>
{facilityDetails &&
includeFacilityContactInfo && (
<FacilityAddress
name={facilityDetails.name}
facility={facilityDetails}
level={2}
/>
)}
<p>Or you can choose a different facility.</p>
</>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('VAOS direct schedule flow - Multiple facilities dead ends', () => {
.selectLocation(/Facility 983/i)
.clickNextButton()
.assertWarningModal({
text: /You.ve reached the limit for appointment requests/i,
text: /You can.t schedule this appointment online/i,
});

// Assert
Expand Down

0 comments on commit 06b21f7

Please sign in to comment.