Skip to content

Commit 5e72c87

Browse files
authored
patch: Align with GDS and Accessibility requirements (#1353)
* patch: Align with GDS and Accessibility * Update layout.html * Update initialiseSession.feature * Update layout.html moving out skip to main content change
1 parent 10da6c7 commit 5e72c87

File tree

11 files changed

+23
-19
lines changed

11 files changed

+23
-19
lines changed

e2e/cypress/e2e/runner/dateValidation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Then("I see the date parts error {string}", (error) => {
2222
/**
2323
* Date parts only show one error at a time.
2424
*/
25-
cy.findByText("Fix the following errors");
25+
cy.findByText("There is a problem");
2626
cy.findByRole("link", { name: error, exact: false });
2727
});
2828

@@ -32,7 +32,7 @@ Then(
3232
/**
3333
* Date parts only show one error at a time.
3434
*/
35-
cy.findByText("Fix the following errors");
35+
cy.findByText("There is a problem");
3636
cy.get(`#${fieldName}-error`).within(() => {
3737
cy.findByText(error, { exact: false });
3838
});

e2e/cypress/e2e/runner/initialiseSession.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Feature: Initialise session - prepopulate a session
66
| form | callbackUrl | redirectPath | message | htmlMessage | title |
77
| initialiseSession | https://61bca17e-fe74-40e0-9c15-a901ad120eca.mock.pstmn.io | /summary | | | |
88
And I go to the initialised session URL
9-
Then I see "Summary"
9+
Then I see the heading "Summary"
1010

1111

1212
Scenario: The configured message is displayed
@@ -15,7 +15,7 @@ Feature: Initialise session - prepopulate a session
1515
| form | callbackUrl | redirectPath | message | htmlMessage | title |
1616
| initialiseSession | https://61bca17e-fe74-40e0-9c15-a901ad120eca.mock.pstmn.io | /summary | your favourite egg is wrong | | |
1717
And I go to the initialised session URL
18-
Then I see "Summary"
18+
Then I see the heading "Summary"
1919
And I see "your favourite egg is wrong"
2020

2121
Scenario: The configured htmlMessage is displayed
@@ -24,7 +24,7 @@ Feature: Initialise session - prepopulate a session
2424
| form | callbackUrl | redirectPath | message | htmlMessage | title |
2525
| initialiseSession | https://61bca17e-fe74-40e0-9c15-a901ad120eca.mock.pstmn.io | /summary | | <p>This is not a type of egg</p> | |
2626
And I go to the initialised session URL
27-
Then I see "Summary"
27+
Then I see the heading "Summary"
2828
And I see "This is not a type of egg"
2929
And I don't see "<p>"
3030

@@ -46,4 +46,4 @@ Feature: Initialise session - prepopulate a session
4646
And I declare and continue
4747
Then I see "Cookies are files saved on your phone"
4848
When I revisit the status page
49-
Then I see "Cookies are files saved on your phone"
49+
Then I see "Cookies are files saved on your phone"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { When } from "@badeball/cypress-cucumber-preprocessor";
22

33
When("I see the error {string} for {string}", (error, fieldName) => {
4-
cy.findByText("Fix the following errors");
4+
cy.findByText("There is a problem");
55
cy.findByRole("link", { name: error });
66
cy.findByRole("group", { description: `Error: ${error}` });
77
});

runner/src/server/plugins/engine/pageControllers/PageControllerBase.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ export class PageControllerBase {
611611
});
612612

613613
formResult.errors = Object.is(formResult.errors, null)
614-
? { titleText: "Fix the following errors" }
614+
? { titleText: "There is a problem" }
615615
: formResult.errors;
616616
formResult.errors.errorList = reformattedErrors;
617617
}
@@ -638,7 +638,7 @@ export class PageControllerBase {
638638
});
639639

640640
formResult.errors = Object.is(formResult.errors, null)
641-
? { titleText: "Fix the following errors" }
641+
? { titleText: "There is a problem" }
642642
: formResult.errors;
643643
formResult.errors.errorList = reformattedErrors;
644644
}
@@ -841,7 +841,7 @@ export class PageControllerBase {
841841
}
842842

843843
get errorSummaryTitle() {
844-
return "Fix the following errors";
844+
return "There is a problem";
845845
}
846846

847847
/**

runner/src/server/plugins/engine/pluginHandlers/exit/prehandlers/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function errorListFromValidationResult(
1919
const errorList = errors.details.map(errorListItemToErrorVM);
2020

2121
return {
22-
titleText: "Fix the following errors",
22+
titleText: "There is a problem",
2323
errorList: errorList.filter(
2424
({ text }, index) =>
2525
index === errorList.findIndex((err) => err.text === text)

runner/src/server/plugins/engine/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export type FormSubmissionState = {
6161
};
6262

6363
export type FormSubmissionErrors = {
64-
titleText: string; // e.b: "Fix the following errors"
64+
titleText: string; // e.b: "There is a problem"
6565
errorList: {
6666
path: string; // e.g: "firstName"
6767
href: string; // e.g: "#firstName"

runner/src/server/plugins/engine/views/components/fileuploadfield.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<p class="govuk-body">You previously uploaded the file ‘{{component.model.value}}’</p>
66
{% endif %}
77
<div class="govuk-error-summary govuk-border-green upload-dialog" aria-labelledby="success-summary-title" role="alert" tabindex="-1">
8-
<h2 class="govuk-!-margin-0 govuk-heading-m" id="success-summary-title">
8+
<p class="govuk-!-margin-0 govuk-heading-m" id="success-summary-title">
99
Your file was successfully selected
10-
</h2>
10+
</p>
1111
</div>
1212
{% endmacro %}

runner/src/server/services/upload/uploadService.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ export class UploadService {
4747
validFiletypesString(customAcceptedTypes?: string[]) {
4848
const acceptedTypes = customAcceptedTypes ?? this.validContentTypes;
4949

50-
const acceptedTypeNames = acceptedTypes
50+
let acceptedTypeNames = acceptedTypes
5151
.map((type) => contentTypeToName[type])
52-
.filter(Boolean);
52+
.filter(Boolean)
53+
.map((type) => type.toUpperCase());
5354

55+
const namesSet = new Set(acceptedTypeNames);
56+
acceptedTypeNames = Array.from(namesSet);
57+
5458
const acceptedTypesNameWithoutLast = acceptedTypeNames
5559
.slice(0, -1)
5660
.join(", ");

runner/test/cases/server/plugins/engine/datepartsfield.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ suite("Date parts field", () => {
6262
type: "DatePartsField",
6363
};
6464
const errors = {
65-
titleText: "Fix the following errors",
65+
titleText: "There is a problem",
6666
errorList: [
6767
{
6868
path: "approximate__day",

runner/test/cases/server/plugins/engine/pageControllers/PageControllerBase.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ suite("PageControllerBase", () => {
6363
};
6464

6565
expect(page.getErrors(error)).to.equal({
66-
titleText: "Fix the following errors",
66+
titleText: "There is a problem",
6767
errorList: [
6868
{
6969
path: "approximate",

0 commit comments

Comments
 (0)