Skip to content

Commit

Permalink
feat(EMS-1046): Accessibility statement (#330)
Browse files Browse the repository at this point in the history
* feat(EMS-1046): accessibility statement page setup

* feat(EMS-1046): accessibility statement content

* feat(EMS-1046): remove req.flash from accessibility statement unit test
  • Loading branch information
ttbarnes authored Feb 20, 2023
1 parent 94692a0 commit 0df7857
Show file tree
Hide file tree
Showing 19 changed files with 656 additions and 1 deletion.
1 change: 1 addition & 0 deletions e2e-tests/constants/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const QUOTE_ROUTES = require('./quote');

const ROUTES = {
ROOT: '/',
ACCESSIBILITY_STATEMENT: '/accessibility-statement',
COOKIES: '/cookies',
PROBLEM_WITH_SERVICE: '/problem-with-service',
QUOTE: QUOTE_ROUTES,
Expand Down
4 changes: 4 additions & 0 deletions e2e-tests/content-strings/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const FOOTER = {
VALUE: 'Monday to Friday, 9am to 5pm (excluding public holidays)',
},
SUPPORT_LINKS_HEADING: 'Support Links',
ACCESSIBILITY_STATEMENT: {
TEXT: 'Accessibility statement',
HREF: ROUTES.ACCESSIBILITY_STATEMENT,
},
PRIVACY: {
TEXT: 'Privacy',
HREF: 'https://www.gov.uk/government/publications/ukef-privacy-notice',
Expand Down
3 changes: 3 additions & 0 deletions e2e-tests/content-strings/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const LINKS = {
NBI_FORM:
'https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/1041659/export-insurance-non-binding-indication-request-form_20170609.pdf',
FULL_APPLICATION: 'https://www.gov.uk/guidance/apply-for-ukef-export-insurance',
ABILITY_NET: 'https://mcmw.abilityNet.org.uk',
EQUALITY_ADVISORY_SERVICE: 'https://www.equalityadvisoryservice.com',
ACCESSIBILITY_GUIDLINES: 'https://www.w3.org/TR/WCAG21',
},
};

Expand Down
77 changes: 77 additions & 0 deletions e2e-tests/content-strings/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,82 @@ const YOUR_QUOTE_PAGE = {
},
};

const ACCESSIBILITY_STATEMENT_PAGE = {
PAGE_TITLE: 'Accessibility Statement for the EXIP Get a Quote Service',
HEADING: 'Accessibility Statement for the EXIP Get a Quote Service',
SERVICE_LINK: {
TEXT: 'Get a quote for UKEF export insurance - GOV.UK (www.gov.uk)',
HREF: LINKS.EXTERNAL.BEFORE_YOU_START,
},
USING_OUR_SERVICE: {
HEADING: 'Using our service',
INTRO: 'This service is run by UK Export Finance. We want as many people as possible to use this service. For example, that means you should be able to:',
LIST: [
'change colours, contrast levels and fonts',
'zoom in up to 300 % without the text spilling off the screen',
'navigate most of the website using just a keyboard',
'navigate most of the website using speech recognition software',
'listen to most of the website using a screen reader (including the most recent versions of JAWS, NVDA and VoiceOver)',
],
OUTRO: {
WEBSITE_TEXT: "We've also made the website text as simple as possible to understand.",
ABILITY_NET: {
LINK: {
TEXT: 'AbilityNet',
HREF: LINKS.EXTERNAL.ABILITY_NET,
},
DESCRIPTION: 'has advice on making your device easier to use if you have a disability.',
},
},
},
FEEDBACK_AND_CONTACT: {
HEADING: 'Feedback and contact information',
INTRO: 'If you need information on this website in a different format like accessible PDF, large print, easy read, contact us:',
LIST: ['customer.service@ukexportfinance.gov.uk', '+44(0)207 271 8010'],
OUTRO: "We'll consider your request and get back to you in 2 days.",
},
REPORTING_PROBLEMS: {
HEADING: 'Reporting accessibility problems with this website',
DESCRIPTION:
"We're always looking to improve the accessibility of this website. If you find any additional problems not listed above or think we're not meeting accessibility requirements, contact: customer.service@ukexportfinance.gov.uk.",
},
ENFORCEMENT_PROCEDURE: {
HEADING: 'Enforcement procedure',
DESCRIPTION:
"The Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the'accessibility regulations'). If you're not happy with how we respond to your complaint,",
CONTACT: {
TEXT: 'contact the Equality Advisory and Support Service (EASS)',
HREF: LINKS.EXTERNAL.EQUALITY_ADVISORY_SERVICE,
},
},
TECHNICAL_INFO: {
HEADING: "Technical information about this website's accessibility",
DESCRIPTION:
'UK Export Finance is committed to making its website accessible, in accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018.',
},
COMPLIANCE_STATUS: {
HEADING: 'Compliance status',
INTRO: 'This website is compliant with the',
GUIDLINES_LINK: {
TEXT: 'Web Content Accessibility Guidelines version 2.1',
HREF: LINKS.EXTERNAL.ACCESSIBILITY_GUIDLINES,
},
OUTRO: 'AA standard.',
},
IMPROVING_ACCESSIBILITY: {
HEADING: "What we're doing to improve accessibility",
DESCRIPTION:
'UK Export Finance is committed to address any issues with the service. The team responsible for the service regularly tests and monitors the accessibility of the service.',
},
PREPERATION_OF_STATEMENT: {
HEADING: 'Preparation of this accessibility statement',
LIST: [
'This statement was prepared 17th February 2023. It was last reviewed on 17th February 2023.',
'This website was last tested on 17th February 2023. The test was carried out by UK Export Finance.',
],
},
};

const COOKIES_PAGE = {
PAGE_TITLE: 'Cookies',
HEADING: 'Cookies',
Expand Down Expand Up @@ -314,6 +390,7 @@ module.exports = {
CANNOT_OBTAIN_COVER_PAGE,
GET_A_QUOTE_BY_EMAIL_PAGE,
YOUR_QUOTE_PAGE,
ACCESSIBILITY_STATEMENT_PAGE,
COOKIES_PAGE,
NEED_TO_START_AGAIN,
PAGE_NOT_FOUND_PAGE,
Expand Down
274 changes: 274 additions & 0 deletions e2e-tests/cypress/e2e/journeys/accessibility-statement.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
import { accessibilityStatementPage } from '../pages';
import partials from '../partials';
import { BUTTONS, LINKS, PAGES } from '../../../content-strings';
import { FIELD_IDS, ROUTES } from '../../../constants';

const {
usingOurService,
feedbackAndContact,
reportingProblems,
enforcementProcedure,
technicalInfo,
complianceStatus,
improvingAccessibility,
preperationOfStatement,
} = accessibilityStatementPage;

const CONTENT_STRINGS = PAGES.ACCESSIBILITY_STATEMENT_PAGE;

const {
HEADING,
SERVICE_LINK,
USING_OUR_SERVICE,
FEEDBACK_AND_CONTACT,
REPORTING_PROBLEMS,
ENFORCEMENT_PROCEDURE,
TECHNICAL_INFO,
COMPLIANCE_STATUS,
IMPROVING_ACCESSIBILITY,
PREPERATION_OF_STATEMENT,
} = CONTENT_STRINGS;

context('Accessibility statement page', () => {
beforeEach(() => {
cy.login();

partials.footer.supportLinks.accessibilityStatement().click();
cy.url().should('include', ROUTES.ACCESSIBILITY_STATEMENT);

Cypress.Cookies.preserveOnce('_csrf');
Cypress.Cookies.preserveOnce('exip-session');
});

it('passes the audits', () => {
cy.lighthouse({
accessibility: 100,
performance: 75,
'best-practices': 100,
seo: 60,
});
});

it('renders an analytics cookies consent banner that can be accepted', () => {
cy.checkAnalyticsCookiesConsentAndAccept();
});

it('renders an analytics cookies consent banner that can be rejected', () => {
cy.rejectAnalyticsCookies();
});

it('renders a back link with correct url', () => {
partials.backLink().should('exist');
partials.backLink().invoke('text').then((text) => {
expect(text.trim()).equal(LINKS.BACK);
});

const expected = `${Cypress.config('baseUrl')}${ROUTES.QUOTE.BUYER_COUNTRY}`;

partials.backLink().should('have.attr', 'href', expected);
});

it('renders a heading', () => {
accessibilityStatementPage.heading().invoke('text').then((text) => {
expect(text.trim()).equal(HEADING);
});
});

it('renders a service link', () => {
accessibilityStatementPage.serviceLink().invoke('text').then((text) => {
expect(text.trim()).equal(SERVICE_LINK.TEXT);
});

accessibilityStatementPage.serviceLink().should('have.attr', 'href', SERVICE_LINK.HREF);
});

describe('using our service', () => {
it('renders a heading', () => {
usingOurService.heading().invoke('text').then((text) => {
expect(text.trim()).equal(USING_OUR_SERVICE.HEADING);
});
});

it('renders an intro', () => {
usingOurService.intro().invoke('text').then((text) => {
expect(text.trim()).equal(USING_OUR_SERVICE.INTRO);
});
});

it('renders a list', () => {
usingOurService.listItem1().invoke('text').then((text) => {
expect(text.trim()).equal(USING_OUR_SERVICE.LIST[0]);
});

usingOurService.listItem2().invoke('text').then((text) => {
expect(text.trim()).equal(USING_OUR_SERVICE.LIST[1]);
});

usingOurService.listItem3().invoke('text').then((text) => {
expect(text.trim()).equal(USING_OUR_SERVICE.LIST[2]);
});

usingOurService.listItem4().invoke('text').then((text) => {
expect(text.trim()).equal(USING_OUR_SERVICE.LIST[3]);
});

usingOurService.listItem5().invoke('text').then((text) => {
expect(text.trim()).equal(USING_OUR_SERVICE.LIST[4]);
});
});

describe('outro', () => {
it('renders AbilityNet link and outro copy', () => {
usingOurService.abilityNet.link().invoke('text').then((text) => {
expect(text.trim()).equal(USING_OUR_SERVICE.OUTRO.ABILITY_NET.LINK.TEXT);
});

usingOurService.abilityNet.link().should('have.attr', 'href', USING_OUR_SERVICE.OUTRO.ABILITY_NET.LINK.HREF);

usingOurService.abilityNet.outro().invoke('text').then((text) => {
expect(text.trim()).equal(USING_OUR_SERVICE.OUTRO.ABILITY_NET.DESCRIPTION);
});
});
});
});

describe('feedback and contact', () => {
it('renders a heading', () => {
feedbackAndContact.heading().invoke('text').then((text) => {
expect(text.trim()).equal(FEEDBACK_AND_CONTACT.HEADING);
});
});

it('renders an intro', () => {
feedbackAndContact.intro().invoke('text').then((text) => {
expect(text.trim()).equal(FEEDBACK_AND_CONTACT.INTRO);
});
});

it('renders an outro', () => {
feedbackAndContact.outro().invoke('text').then((text) => {
expect(text.trim()).equal(FEEDBACK_AND_CONTACT.OUTRO);
});
});

it('renders a list', () => {
feedbackAndContact.listItem1().invoke('text').then((text) => {
expect(text.trim()).equal(FEEDBACK_AND_CONTACT.LIST[0]);
});

feedbackAndContact.listItem2().invoke('text').then((text) => {
expect(text.trim()).equal(FEEDBACK_AND_CONTACT.LIST[1]);
});
});
});

describe('reporting problems', () => {
it('renders a heading', () => {
reportingProblems.heading().invoke('text').then((text) => {
expect(text.trim()).equal(REPORTING_PROBLEMS.HEADING);
});
});

it('renders an description', () => {
reportingProblems.description().invoke('text').then((text) => {
expect(text.trim()).equal(REPORTING_PROBLEMS.DESCRIPTION);
});
});
});

describe('enforcement procedure', () => {
it('renders a heading', () => {
enforcementProcedure.heading().invoke('text').then((text) => {
expect(text.trim()).equal(ENFORCEMENT_PROCEDURE.HEADING);
});
});

it('renders an description', () => {
enforcementProcedure.description().invoke('text').then((text) => {
expect(text.trim()).equal(ENFORCEMENT_PROCEDURE.DESCRIPTION);
});
});

it('renders a link', () => {
enforcementProcedure.link().invoke('text').then((text) => {
expect(text.trim()).equal(ENFORCEMENT_PROCEDURE.CONTACT.TEXT);
});

enforcementProcedure.link().should('have.attr', 'href', ENFORCEMENT_PROCEDURE.CONTACT.HREF);
});
});

describe('technical info', () => {
it('renders a heading', () => {
technicalInfo.heading().invoke('text').then((text) => {
expect(text.trim()).equal(TECHNICAL_INFO.HEADING);
});
});

it('renders an description', () => {
technicalInfo.description().invoke('text').then((text) => {
expect(text.trim()).equal(TECHNICAL_INFO.DESCRIPTION);
});
});
});

describe('compliance status', () => {
it('renders a heading', () => {
complianceStatus.heading().invoke('text').then((text) => {
expect(text.trim()).equal(COMPLIANCE_STATUS.HEADING);
});
});

it('renders an intro', () => {
complianceStatus.intro().invoke('text').then((text) => {
expect(text.trim()).equal(COMPLIANCE_STATUS.INTRO);
});
});

it('renders a link', () => {
complianceStatus.link().invoke('text').then((text) => {
expect(text.trim()).equal(COMPLIANCE_STATUS.GUIDLINES_LINK.TEXT);
});

complianceStatus.link().should('have.attr', 'href', COMPLIANCE_STATUS.GUIDLINES_LINK.HREF);
});

it('renders an outro', () => {
complianceStatus.outro().invoke('text').then((text) => {
expect(text.trim()).equal(COMPLIANCE_STATUS.OUTRO);
});
});
});

describe('improving accessibility', () => {
it('renders a heading', () => {
improvingAccessibility.heading().invoke('text').then((text) => {
expect(text.trim()).equal(IMPROVING_ACCESSIBILITY.HEADING);
});
});

it('renders an description', () => {
improvingAccessibility.description().invoke('text').then((text) => {
expect(text.trim()).equal(IMPROVING_ACCESSIBILITY.DESCRIPTION);
});
});
});

describe('preperation of statement', () => {
it('renders a heading', () => {
preperationOfStatement.heading().invoke('text').then((text) => {
expect(text.trim()).equal(PREPERATION_OF_STATEMENT.HEADING);
});
});

it('renders a list', () => {
preperationOfStatement.listItem1().invoke('text').then((text) => {
expect(text.trim()).equal(PREPERATION_OF_STATEMENT.LIST[0]);
});

preperationOfStatement.listItem2().invoke('text').then((text) => {
expect(text.trim()).equal(PREPERATION_OF_STATEMENT.LIST[1]);
});
});
});
});
Loading

0 comments on commit 0df7857

Please sign in to comment.