Skip to content

Commit

Permalink
fix(EMS-1046): accessibility statement - add missing E2E test for foo…
Browse files Browse the repository at this point in the history
…ter link (#332)

* fix(EMS-1046): accessibility statement - add missing E2E test for footer link

* fix(EMS-1046): improve footer E2E test descriptions
  • Loading branch information
ttbarnes authored Feb 20, 2023
1 parent 9ab9054 commit 66552b4
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions e2e-tests/cypress/e2e/journeys/footer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@ context('Footer', () => {
});
});

it(`renders a link to ${FOOTER.COOKIES.TEXT} and redirects to the correct URL`, () => {
it(`renders a ${FOOTER.ACCESSIBILITY_STATEMENT.TEXT} link with the correct URL`, () => {
footer.supportLinks.accessibilityStatement().invoke('text').then((text) => {
expect(text.trim()).equal(FOOTER.ACCESSIBILITY_STATEMENT.TEXT);
});

footer.supportLinks.accessibilityStatement().click();
cy.url().should('include', FOOTER.ACCESSIBILITY_STATEMENT.HREF);
});

it(`renders a ${FOOTER.COOKIES.TEXT} link with the correct URL`, () => {
footer.supportLinks.cookies().invoke('text').then((text) => {
expect(text.trim()).equal(FOOTER.COOKIES.TEXT);
});
Expand All @@ -52,15 +61,15 @@ context('Footer', () => {
cy.url().should('include', FOOTER.COOKIES.HREF);
});

it(`renders a link to ${FOOTER.REPORT_VULNERABILITY.TEXT} and redirects to the correct URL`, () => {
it(`renders a ${FOOTER.REPORT_VULNERABILITY.TEXT} link with the correct URL`, () => {
footer.supportLinks.reportVulnerability().invoke('text').then((text) => {
expect(text.trim()).equal(FOOTER.REPORT_VULNERABILITY.TEXT);
});

footer.supportLinks.reportVulnerability().should('have.attr', 'href', FOOTER.REPORT_VULNERABILITY.HREF);
});

it(`renders a link to ${FOOTER.OGL_LICENCE.LICENCE} and redirects to the correct URL`, () => {
it(`renders a ${FOOTER.OGL_LICENCE.LICENCE} link with the correct URL`, () => {
footer.supportLinks.license().invoke('text').then((text) => {
expect(text.trim()).includes(FOOTER.OGL_LICENCE.INTRO);
expect(text.trim()).includes(FOOTER.OGL_LICENCE.LICENCE);
Expand All @@ -70,7 +79,7 @@ context('Footer', () => {
footer.supportLinks.licenseLink().should('have.attr', 'href', FOOTER.OGL_LICENCE.HREF);
});

it(`renders a link to ${FOOTER.CROWN_COPYRIGHT.TEXT} and redirects to the correct URL`, () => {
it(`renders a ${FOOTER.CROWN_COPYRIGHT.TEXT} link with the correct URL`, () => {
footer.supportLinks.copyright().invoke('text').then((text) => {
const expected = ${FOOTER.CROWN_COPYRIGHT.TEXT}`;
expect(text.trim()).equal(expected);
Expand Down

0 comments on commit 66552b4

Please sign in to comment.