Skip to content

Commit

Permalink
PP-13255 Add error summary to org details form (#4380)
Browse files Browse the repository at this point in the history
  • Loading branch information
DomBelcher authored Dec 10, 2024
1 parent 187ba8f commit 2133669
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
href: backLink
}) if backLink }}

{% if errors %}
{{ govukErrorSummary({
titleText: "There is a problem",
errorList: errors.summary
}) }}
{% endif %}

<h1 class="govuk-heading-l">Organisation details</h1>

<p class="govuk-body govuk-!-margin-bottom-6 hint-and-body-width">Payment card schemes require the details of the organisation taking payment to be shown on payment pages.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@ describe('Organisation details settings', () => {

cy.location('pathname').should('eq', `/simplified/service/${SERVICE_EXTERNAL_ID}/account/${ACCOUNT_TYPE}/settings/organisation-details/edit`)

cy.get('.govuk-error-summary')
.should('exist')
.should('contain', 'Organisation name must be 100 characters or fewer')
.should('contain', 'Enter a building and street')
.should('contain', 'Enter a town or city')
.should('contain', 'Enter a real postcode')
.should('contain', 'Enter a telephone number, like 01632 960 001, 07700 900 982 or +44 0808 157 0192')
.should('contain', 'Enter a valid website address')

cy.get('#organisation-name-error').should('contain.text', 'Organisation name must be 100 characters or fewer')
cy.get('#address-line1-error').should('contain.text', 'Enter a building and street')
cy.get('#address-city-error').should('contain.text', 'Enter a town or city')
Expand Down

0 comments on commit 2133669

Please sign in to comment.