From 66552b486a900a0817043a422890d42666561c49 Mon Sep 17 00:00:00 2001 From: Tony Barnes Date: Mon, 20 Feb 2023 14:30:28 +0000 Subject: [PATCH] fix(EMS-1046): accessibility statement - add missing E2E test for footer link (#332) * fix(EMS-1046): accessibility statement - add missing E2E test for footer link * fix(EMS-1046): improve footer E2E test descriptions --- e2e-tests/cypress/e2e/journeys/footer.spec.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/e2e-tests/cypress/e2e/journeys/footer.spec.js b/e2e-tests/cypress/e2e/journeys/footer.spec.js index 90aeb4bffb..e7643cab21 100644 --- a/e2e-tests/cypress/e2e/journeys/footer.spec.js +++ b/e2e-tests/cypress/e2e/journeys/footer.spec.js @@ -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); }); @@ -52,7 +61,7 @@ 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); }); @@ -60,7 +69,7 @@ context('Footer', () => { 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); @@ -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);