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

[10-10CG] Update Facility Confirmation Page #33807

Merged
merged 2 commits into from
Dec 31, 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 @@ -32,9 +32,10 @@ const FacilityConfirmation = props => {
const addressText = facility => {
return (
<>
<h5 className="vads-u-font-size--h4 vads-u-margin-top--0">
<strong className="vads-u-font-size--h4 vads-u-margin-top--0">
{facility.name}
</h5>
</strong>
<br role="presentation" />
{facility?.address?.physical?.address1 && (
<>
{facility.address.physical.address1}
Expand All @@ -56,23 +57,25 @@ const FacilityConfirmation = props => {

return (
<div>
<h3>Confirm your health care facilities</h3>
<h4>The Veteran’s facility you selected</h4>
<h3>Caregiver support location</h3>
<p>
This is the facility where you told us the Veteran receives or plans to
receive treatment.
</p>
<va-card>{addressText(selectedFacility)}</va-card>
<h4>Your assigned caregiver support facility</h4>
<p>
This is the facility we’ve assigned to support you in the application
process and has a caregiver support coordinator on staff. The
coordinator at this facility will support you through the application
process.
This is the location we’ve assigned to support the caregiver in the
application process:
</p>
<p className="va-address-block">
{addressText(selectedCaregiverSupportFacility)}
</p>
<p>
This VA health facility has a Caregiver Support Team coordinator. And
this facility is closest to where the Veteran receives or plans to
receive care.
</p>
<h4>The Veteran’s VA health facility</h4>
<p>
The Veteran will still receive their health care at the facility you
selected:
</p>
<p className="va-address-block">{addressText(selectedFacility)}</p>
<FormNavButtons goBack={onGoBack} goForward={onGoForward} />
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,8 @@ describe('CG <FacilityConfirmation>', () => {
const { getByText, getByRole } = render(
<FacilityConfirmation {...props} />,
);
const selectedFacilityAddress = selectedFacility.address.physical;
const caregiverFacilityAddress = caregiverFacility.address.physical;

const selectors = () => ({
selectedFacility: {
name: getByText(new RegExp(selectedFacility.name)),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced these with selectors in the specs to simplify these tests a bit.

address1: getByText(new RegExp(selectedFacilityAddress.address1)),
address2: getByText(new RegExp(selectedFacilityAddress.address2)),
address3: getByText(new RegExp(selectedFacilityAddress.address3)),
},
caregiverFacility: {
name: getByText(new RegExp(caregiverFacility.name)),
address1: getByText(new RegExp(caregiverFacilityAddress.address1)),
address2: getByText(new RegExp(caregiverFacilityAddress.address2)),
address3: getByText(new RegExp(caregiverFacilityAddress.address3)),
},
formNavButtons: {
back: getByText('Back'),
forward: getByText('Continue'),
Expand Down Expand Up @@ -103,65 +89,23 @@ describe('CG <FacilityConfirmation>', () => {
});
});

it('renders selected facility description text', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Went ahead and removed this test since it wasn't really adding value.

const { getByRole, getByText } = subject();
expect(
getByRole('heading', {
level: 3,
name: /Confirm your health care facilities/i,
}),
).to.be.visible;
expect(
getByRole('heading', {
level: 4,
name: /The Veteran’s Facility you selected/i,
}),
).to.be.visible;
expect(
getByText(
/This is the facility where you told us the Veteran receives or plans to receive treatment/i,
),
).to.be.visible;
});

it('should render veteran selected facility name', () => {
const { selectors } = subject();
expect(selectors().selectedFacility.name).to.exist;
});

it('should render veteran selected facility address', () => {
const { selectors } = subject();

expect(selectors().selectedFacility.address1).to.exist;
expect(selectors().selectedFacility.address2).to.exist;
expect(selectors().selectedFacility.address3).to.exist;
});

it('renders caregive facility description text', () => {
const { getByRole, getByText } = subject();
expect(
getByRole('heading', {
level: 4,
name: /Your assigned caregiver support facility/i,
}),
).to.be.visible;
expect(
getByText(
/This is the facility we’ve assigned to support you in the application process and has a caregiver support coordinator on staff. The coordinator at this facility will support you through the application process./i,
),
).to.be.visible;
});
it('should render caregiver facility name and address', () => {
const { getByText } = subject();
const caregiverFacilityAddress = caregiverFacility.address.physical;

it('should render caregiver facility name', () => {
const { selectors } = subject();
expect(selectors().caregiverFacility.name).to.exist;
expect(getByText(new RegExp(caregiverFacility.name))).to.exist;
expect(getByText(new RegExp(caregiverFacilityAddress.address1))).to.exist;
expect(getByText(new RegExp(caregiverFacilityAddress.address2))).to.exist;
expect(getByText(new RegExp(caregiverFacilityAddress.address3))).to.exist;
});

it('should render caregiver facility address', () => {
const { selectors } = subject();
it('should render veteran selected facility name and address', () => {
const { getByText } = subject();
const selectedFacilityAddress = selectedFacility.address.physical;

expect(selectors().caregiverFacility.address1).to.exist;
expect(selectors().caregiverFacility.address2).to.exist;
expect(selectors().caregiverFacility.address3).to.exist;
expect(getByText(new RegExp(selectedFacility.name))).to.exist;
expect(getByText(new RegExp(selectedFacilityAddress.address1))).to.exist;
expect(getByText(new RegExp(selectedFacilityAddress.address2))).to.exist;
expect(getByText(new RegExp(selectedFacilityAddress.address3))).to.exist;
});
});
Loading