Skip to content

Commit

Permalink
Merge pull request #180 from DEFRA/DSFAAP-764_accessibility-statement
Browse files Browse the repository at this point in the history
Accessibility statement page
  • Loading branch information
joseluisgraa authored Jan 31, 2025
2 parents 6273439 + 504de8d commit f8b2838
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 9 deletions.
53 changes: 53 additions & 0 deletions src/server/accessibility/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`#accessibilityStatementPage should render expected response and content 1`] = `
"
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div class="govuk-body" data-testid="app-page-body">
<h1 class="govuk-heading-l">Accessibility statement</h1>
<p class="govuk-body">
Accessibility statement for Get permission to move animals under
disease control.
</p>
<h2 class="govuk-heading-m">
How you should be able to use this website
</h2>
<p class="govuk-body">
We want as many people as possible to be able to use this website.
</p>
<p class="govuk-body">You should be able to:</p>
<ul class="govuk-list govuk-list--bullet">
<li>
Change colours, contrast levels and fonts using browser or device
settings
</li>
<li>Zoom in up to 200% without the text spilling off the screen</li>
<li>
Navigate most of the website using a keyboard or speech recognition
software
</li>
<li>
Listen to most of the website using a screen reader (including the
most recent versions of JAWS, NVDA and VoiceOver)
</li>
<li>
We also make the website text as simple as possible to understand
</li>
</ul>
<h2 class="govuk-heading-m">How accessible this website is</h2>
<p class="govuk-body">
While most of this website is fully accessible, we are engaging in a
full accessibility audit that may uncover unknown accessibility
issues. If you encounter any, please
<a data-testid="feedback-link" target="_blank" class="govuk-link" href="https://defragroup.eu.qualtrics.com/jfe/form/SV_7ZDFNwIA2wLF9lk">give your feedback (opens in new tab)
</a>
to let us know how we can improve.
</p>
</div>
</div>
</div>
"
`;
26 changes: 26 additions & 0 deletions src/server/accessibility/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Page } from '~/src/server/common/model/page/page-model.js'
import { PageController } from '~/src/server/common/controller/page-controller/page-controller.js'

const pageTitle = 'Accessibility statement'

export class AccessibilityStatementPage extends Page {
sectionKey = 'policies'
key = 'accessibility-statement'
pageTitle = pageTitle
pageHeading = pageTitle
urlPath = '/accessibility-statement'
view = 'accessibility/index'
}

export const accessibilityStatementPage = new AccessibilityStatementPage()

/**
* @satisfies {ServerRegisterPluginObject<void>}
*/
export const accessibilityStatement = new PageController(
accessibilityStatementPage
).plugin()

/**
* @import { ServerRegisterPluginObject } from '@hapi/hapi'
*/
58 changes: 58 additions & 0 deletions src/server/accessibility/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{%
extends
'layouts/page.njk'
%}
{% block content %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div class="govuk-body" data-testid="app-page-body">
<h1 class="govuk-heading-l">{{ heading }}</h1>
<p class="govuk-body">
Accessibility statement for Get permission to move animals under
disease control.
</p>

<h2 class="govuk-heading-m">
How you should be able to use this website
</h2>
<p class="govuk-body">
We want as many people as possible to be able to use this website.
</p>
<p class="govuk-body">You should be able to:</p>
<ul class="govuk-list govuk-list--bullet">
<li>
Change colours, contrast levels and fonts using browser or device
settings
</li>
<li>Zoom in up to 200% without the text spilling off the screen</li>
<li>
Navigate most of the website using a keyboard or speech recognition
software
</li>
<li>
Listen to most of the website using a screen reader (including the
most recent versions of JAWS, NVDA and VoiceOver)
</li>
<li>
We also make the website text as simple as possible to understand
</li>
</ul>

<h2 class="govuk-heading-m">How accessible this website is</h2>
<p class="govuk-body">
While most of this website is fully accessible, we are engaging in a
full accessibility audit that may uncover unknown accessibility
issues. If you encounter any, please
<a
data-testid="feedback-link"
target="_blank"
class="govuk-link"
href="https://defragroup.eu.qualtrics.com/jfe/form/SV_7ZDFNwIA2wLF9lk"
>give your feedback (opens in new tab)
</a>
to let us know how we can improve.
</p>
</div>
</div>
</div>
{% endblock %}
7 changes: 7 additions & 0 deletions src/server/accessibility/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describePageSnapshot } from '../common/test-helpers/snapshot-page.js'

describePageSnapshot({
describes: '#accessibilityStatementPage',
it: 'should render expected response and content',
pageUrl: '/accessibility-statement'
})
2 changes: 1 addition & 1 deletion src/server/common/templates/layouts/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
}
},
{
href: "https://www.gov.uk/help/accessibility-statement",
href: "/accessibility-statement",
text: "Accessibility statement",
attributes: {
'data-testid': 'accessibility-statement-link'
Expand Down
2 changes: 1 addition & 1 deletion src/server/cookies-policy/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`#destinationSummaryController should render expected response and content 1`] = `
exports[`#cookiesPolicyPage should render expected response and content 1`] = `
"
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
Expand Down
2 changes: 2 additions & 0 deletions src/server/cookies-policy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Page } from '~/src/server/common/model/page/page-model.js'
import { PageController } from '~/src/server/common/controller/page-controller/page-controller.js'

export class CookiesPolicyPage extends Page {
sectionKey = 'policies'
key = 'cookies'
pageTitle = 'Cookies'
pageHeading = 'Cookies'
urlPath = '/cookies'
Expand Down
6 changes: 1 addition & 5 deletions src/server/cookies-policy/index.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { describePageSnapshot } from '../common/test-helpers/snapshot-page.js'

describePageSnapshot({
describes: '#destinationSummaryController',
describes: '#cookiesPolicyPage',
it: 'should render expected response and content',
pageUrl: '/cookies'
})

/**
* @import { Server } from '@hapi/hapi'
*/
2 changes: 2 additions & 0 deletions src/server/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { receiveMethod } from './licence/receiveMethod/index.js'
import { postExit } from './licence/postExitPage/index.js'
import { fullName } from './licence/fullName/index.js'
import { cookiesPolicy } from './cookies-policy/index.js'
import { accessibilityStatement } from './accessibility/index.js'
import { config } from '../config/config.js'
import { keptSeparately } from './biosecurity/kept-separately/index.js'

Expand All @@ -37,6 +38,7 @@ export const router = {
home,
privacyPolicy,
cookiesPolicy,
accessibilityStatement,
origin,
destination,
licence,
Expand Down
11 changes: 11 additions & 0 deletions user-journey-tests/page-objects/accessibilityStatementPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Page } from './page.js'

const pageHeadingAndTitle = 'Accessibility statement'

class AccessibilityStatementPage extends Page {
pagePath = '/accessibility-statement'
pageHeading = pageHeadingAndTitle
pageTitle = pageHeadingAndTitle
}

export default new AccessibilityStatementPage()
4 changes: 3 additions & 1 deletion user-journey-tests/page-objects/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,20 @@ class Page {
this.getPricacyFooterLink(),
'/privacy-policy'
)

await page.validateElementVisibleAndText(
this.getCookiesFooterLink(),
'Cookies'
)
await page.validateHrefOfElement(this.getCookiesFooterLink(), '/cookies')

await page.validateElementVisibleAndText(
this.getAccessibilityFooterLink(),
'Accessibility statement'
)
await page.validateHrefOfElement(
this.getAccessibilityFooterLink(),
'https://www.gov.uk/help/accessibility-statement'
'/accessibility-statement'
)
}

Expand Down
4 changes: 3 additions & 1 deletion user-journey-tests/specs/landing.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
import cookiesPage from '../page-objects/cookiesPage.js'
import landingPage from '../page-objects/landingPage.js'
import taskListPage from '../page-objects/taskListPage.js'
import accessibilityStatementPage from '../page-objects/accessibilityStatementPage.js'

describe('Landing page test', () => {
beforeEach('Reset browser state and navigate to page', async () => {
Expand Down Expand Up @@ -42,6 +43,7 @@ describe('Landing page test', () => {

it('Should verify the accessibility link in the footer', async () => {
await selectElement(landingPage.getAccessibilityFooterLink())
await waitForFullPageUrl('https://www.gov.uk/help/accessibility-statement')
await waitForPagePath(accessibilityStatementPage.pagePath)
await accessibilityStatementPage.verifyPageHeadingAndTitle()
})
})

0 comments on commit f8b2838

Please sign in to comment.