Skip to content

Commit

Permalink
VACMS-19913 Pharmacy text update for health services and VAMC pages (#…
Browse files Browse the repository at this point in the history
…2363)

* VACMS-19913 Pharmacy text update for health services and VAMC pages

* Fixing Cypress tests

* Fix Lovell tests
  • Loading branch information
randimays authored Nov 25, 2024
1 parent 875d2bf commit afb9989
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@
This is used for Facility details pages and (A-Z) Health Services page
{% endcomment %}
<div data-template="facilities/facilities_health_services_buttons">
<div>
{% assign topTask = "make-an-appointment" | topTaskLovellComp: path, buildtype, fieldAdministration, fieldVamcEhrSystem, fieldRegionPage, fieldOffice %}
<a class="vads-c-action-link--blue" href="{{topTask.url}}">{{topTask.text}}</a>
</div>
<div class="vads-u-margin-y--2">
<a class="vads-c-action-link--blue" href="/{{ path }}/register-for-care">Register for care</a>
</div>
<div>
<a class="vads-c-action-link--blue" href="/{{ path }}/pharmacy">Pharmacy</a>
</div>
{% assign topTask = "make-an-appointment" | topTaskLovellComp: path, buildtype, fieldAdministration, fieldVamcEhrSystem, fieldRegionPage, fieldOffice %}
<va-link-action
class="vads-u-display--block"
href="{{topTask.url}}"
text="{{topTask.text}}"
type="secondary"
></va-link-action>
<va-link-action
class="vads-u-display--block"
href="/{{ path }}/register-for-care"
text="Register for care"
type="secondary"
></va-link-action>
<va-link-action
class="vads-u-display--block"
href="/{{ path }}/pharmacy"
text="Learn about pharmacy services"
type="secondary"
></va-link-action>
</div>
60 changes: 36 additions & 24 deletions src/site/tests/cypress/vamc-lovell.cypress.spec.js
Original file line number Diff line number Diff line change
@@ -1,89 +1,101 @@
import { expect } from 'chai';

const verifyActionLink = (expectedText, expectedHref) =>
cy
.get('va-link-action')
.eq(0)
.shadow()
.find('a')
.should('be.visible')
.should('have.text', expectedText)
.should('have.attr', 'href')
.and('include', expectedHref);

describe('VAMC Lovell - All TRICARE pages with expected MHS Genesis Patient Portal Top Task have it', () => {
it('TRICARE system has MHS Genesis Patient Portal link', () => {
cy.visit('/lovell-federal-health-care-tricare/');
cy.injectAxeThenAxeCheck();

cy.findByText('MHS Genesis Patient Portal').then(el => {
const attr = el.attr('href');
expect(attr).to.equal('https://my.mhsgenesis.health.mil/');
});
// https://www.va.gov/lovell-federal-health-care-tricare/
});

it('TRICARE Health services has MHS Genesis Patient Portal link', () => {
cy.visit('/lovell-federal-health-care-tricare/health-services');
cy.injectAxeThenAxeCheck();
cy.findByText('MHS Genesis Patient Portal').then(el => {
const attr = el.attr('href');
expect(attr).to.equal('https://my.mhsgenesis.health.mil/');
});
// https://www.va.gov/lovell-federal-health-care-tricare/health-services/

verifyActionLink(
'MHS Genesis Patient Portal',
'https://my.mhsgenesis.health.mil/',
);
});

it('TRICARE Locations has MHS Genesis Patient Portal link', () => {
cy.visit('/lovell-federal-health-care-tricare/locations');
cy.injectAxeThenAxeCheck();

cy.findByText('MHS Genesis Patient Portal').then(el => {
const attr = el.attr('href');
expect(attr).to.equal('https://my.mhsgenesis.health.mil/');
});
// https://www.va.gov/lovell-federal-health-care-tricare/locations/
});

it('TRICARE Captain James A. Lovell Location has MHS Genesis Patient Portal link', () => {
cy.visit(
'/lovell-federal-health-care-tricare/locations/captain-james-a-lovell-federal-health-care-center/',
);
cy.injectAxeThenAxeCheck();
cy.findByText('MHS Genesis Patient Portal').then(el => {
const attr = el.attr('href');
expect(attr).to.equal('https://my.mhsgenesis.health.mil/');
});
// https://www.va.gov/lovell-federal-health-care-tricare/locations/captain-james-a-lovell-federal-health-care-center/

verifyActionLink(
'MHS Genesis Patient Portal',
'https://my.mhsgenesis.health.mil/',
);
});
});

describe('VAMC Lovell - All VA pages with expected Make an appointment Top Task have it', () => {
it('VA system has Make an appointment link', () => {
cy.visit('/lovell-federal-health-care-va/');
cy.injectAxeThenAxeCheck();

cy.findByText('Make an appointment').then(el => {
const attr = el.attr('href');
expect(attr.endsWith('make-an-appointment')).to.be.true;
});
// https://www.va.gov/lovell-federal-health-care-va/
});

it('VA Health services has Make an appointment link', () => {
cy.visit('/lovell-federal-health-care-va/health-services/');
cy.injectAxeThenAxeCheck();
cy.findByText('Make an appointment').then(el => {
const attr = el.attr('href');
expect(attr.endsWith('make-an-appointment')).to.be.true;
});
// https://www.va.gov/lovell-federal-health-care-va/health-services/

verifyActionLink(
'Make an appointment',
'/lovell-federal-health-care-va/make-an-appointment',
);
});

it('VA Locations has Make an appointment link', () => {
cy.visit('/lovell-federal-health-care-va/locations/');
cy.injectAxeThenAxeCheck();

cy.findByText('Make an appointment').then(el => {
const attr = el.attr('href');
expect(attr.endsWith('make-an-appointment')).to.be.true;
});
// https://www.va.gov/lovell-federal-health-care-va/locations/
});

it('VA Captain James A. Lovell Location has Make an appointment link', () => {
cy.visit(
'/lovell-federal-health-care-va/locations/captain-james-a-lovell-federal-health-care-center/',
);
cy.injectAxeThenAxeCheck();
cy.findByText('Make an appointment').then(el => {
const attr = el.attr('href');
expect(attr.endsWith('make-an-appointment')).to.be.true;
});
// https://www.va.gov/lovell-federal-health-care-va/locations/captain-james-a-lovell-federal-health-care-center/

verifyActionLink(
'Make an appointment',
'/lovell-federal-health-care-va/make-an-appointment',
);
});
});

Expand Down

0 comments on commit afb9989

Please sign in to comment.