Skip to content

Commit

Permalink
MLPAB-1395 Evidence successfully uploaded page (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawx authored Nov 1, 2023
1 parent e0254c9 commit 84fa277
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 41 deletions.
5 changes: 2 additions & 3 deletions cypress/e2e/donor/payment.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('Pay for LPA', () => {

cy.contains('button', 'Continue').click()

cy.url().should('contain', '/what-happens-after-no-fee');
cy.url().should('contain', '/evidence-successfully-uploaded');
cy.checkA11yApp();
})

Expand Down Expand Up @@ -187,8 +187,7 @@ describe('Pay for LPA', () => {

cy.contains('button', 'Continue').click()

// TODO: update once designs for page are finalised
cy.url().should('contain', '/what-happens-after-no-fee');
cy.url().should('contain', '/evidence-successfully-uploaded');
cy.checkA11yApp();
})

Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/donor/previous-application-number.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Previous application number', () => {
cy.get('#f-previous-application-number').type('MABC');
cy.contains('button', 'Save and continue').click();

cy.url().should('contain', '/what-happens-after-no-fee');
cy.url().should('contain', '/evidence-successfully-uploaded');
});

it('errors when unselected', () => {
Expand All @@ -27,9 +27,9 @@ describe('Previous application number', () => {
cy.contains('button', 'Save and continue').click();

cy.get('.govuk-error-summary').within(() => {
cy.contains('Previous reference number must begin with 7 or M');
cy.contains('Previous reference number must begin with the number 7 or the letter M');
});

cy.contains('.govuk-error-message', 'Previous reference number must begin with 7 or M');
cy.contains('.govuk-error-message', 'Previous reference number must begin with the number 7 or the letter M');
});
});
2 changes: 1 addition & 1 deletion internal/page/donor/previous_application_number.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func PreviousApplicationNumber(tmpl template.Template, donorStore DonorStore) Ha
if lpa.PreviousApplicationNumber[0] == '7' {
return appData.Redirect(w, r, lpa, page.Paths.PreviousFee.Format(lpa.ID))
} else {
return appData.Redirect(w, r, lpa, page.Paths.WhatHappensAfterNoFee.Format(lpa.ID))
return appData.Redirect(w, r, lpa, page.Paths.EvidenceSuccessfullyUploaded.Format(lpa.ID))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions internal/page/donor/previous_application_number_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestGetPreviousApplicationNumberWhenTemplateErrors(t *testing.T) {
func TestPostPreviousApplicationNumber(t *testing.T) {
testcases := map[string]page.LpaPath{
"7": page.Paths.PreviousFee,
"M": page.Paths.WhatHappensAfterNoFee,
"M": page.Paths.EvidenceSuccessfullyUploaded,
}

for start, redirect := range testcases {
Expand Down Expand Up @@ -125,7 +125,7 @@ func TestPostPreviousApplicationNumberWhenNotChanged(t *testing.T) {

assert.Nil(t, err)
assert.Equal(t, http.StatusFound, resp.StatusCode)
assert.Equal(t, page.Paths.WhatHappensAfterNoFee.Format("lpa-id"), resp.Header.Get("Location"))
assert.Equal(t, page.Paths.EvidenceSuccessfullyUploaded.Format("lpa-id"), resp.Header.Get("Location"))
}

func TestPostPreviousApplicationNumberWhenStoreErrors(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/page/donor/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ func Register(
HowWouldYouLikeToSendEvidence(tmpls.Get("how_would_you_like_to_send_evidence.gohtml")))
handleWithLpa(page.Paths.UploadEvidence, CanGoBack,
UploadEvidence(tmpls.Get("upload_evidence.gohtml"), payer, donorStore, random.UuidString, evidenceS3Client))
handleWithLpa(page.Paths.WhatHappensAfterNoFee, None,
Guidance(tmpls.Get("what_happens_after_no_fee.gohtml")))
handleWithLpa(page.Paths.EvidenceSuccessfullyUploaded, None,
Guidance(tmpls.Get("evidence_successfully_uploaded.gohtml")))
handleWithLpa(page.Paths.HowToEmailOrPostEvidence, CanGoBack,
HowToEmailOrPostEvidence(tmpls.Get("how_to_email_or_post_evidence.gohtml"), payer))
handleWithLpa(page.Paths.FeeDenied, None,
Expand Down Expand Up @@ -484,7 +484,7 @@ func (p *payHelper) Pay(appData page.AppData, w http.ResponseWriter, r *http.Req
return err
}

return appData.Redirect(w, r, lpa, page.Paths.WhatHappensAfterNoFee.Format(lpa.ID))
return appData.Redirect(w, r, lpa, page.Paths.EvidenceSuccessfullyUploaded.Format(lpa.ID))
}

createPaymentBody := pay.CreatePaymentBody{
Expand Down
4 changes: 2 additions & 2 deletions internal/page/donor/register_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ func TestPayHelperPayWhenPaymentNotRequired(t *testing.T) {

assert.Nil(t, err)
assert.Equal(t, http.StatusFound, resp.StatusCode)
assert.Equal(t, page.Paths.WhatHappensAfterNoFee.Format("lpa-id"), resp.Header.Get("Location"))
assert.Equal(t, page.Paths.EvidenceSuccessfullyUploaded.Format("lpa-id"), resp.Header.Get("Location"))
})
}
}
Expand Down Expand Up @@ -521,7 +521,7 @@ func TestPayHelperPayWhenMoreEvidenceProvided(t *testing.T) {

assert.Nil(t, err)
assert.Equal(t, http.StatusFound, resp.StatusCode)
assert.Equal(t, page.Paths.WhatHappensAfterNoFee.Format("lpa-id"), resp.Header.Get("Location"))
assert.Equal(t, page.Paths.EvidenceSuccessfullyUploaded.Format("lpa-id"), resp.Header.Get("Location"))
}

func TestPayHelperPayNoPaymentRequiredWhenS3ClientError(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions internal/page/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ type AppPaths struct {
EnterTrustCorporation LpaPath
EnterTrustCorporationAddress LpaPath
EvidenceRequired LpaPath
EvidenceSuccessfullyUploaded LpaPath
FeeDenied LpaPath
GettingHelpSigning LpaPath
HowDoYouKnowYourCertificateProvider LpaPath
Expand All @@ -157,6 +158,7 @@ type AppPaths struct {
NeedHelpSigningConfirmation LpaPath
PaymentConfirmation LpaPath
PreviousApplicationNumber LpaPath
PreviousFee LpaPath
Progress LpaPath
ProveYourIdentity LpaPath
ReadYourLpa LpaPath
Expand All @@ -172,8 +174,6 @@ type AppPaths struct {
UploadEvidence LpaPath
UseExistingAddress LpaPath
WhatACertificateProviderDoes LpaPath
WhatHappensAfterNoFee LpaPath
PreviousFee LpaPath
WhenCanTheLpaBeUsed LpaPath
WhichFeeTypeAreYouApplyingFor LpaPath
WithdrawThisLpa LpaPath
Expand Down Expand Up @@ -268,6 +268,7 @@ var Paths = AppPaths{
EnterTrustCorporation: "/enter-trust-corporation",
EnterTrustCorporationAddress: "/enter-trust-corporation-address",
EvidenceRequired: "/evidence-required",
EvidenceSuccessfullyUploaded: "/evidence-successfully-uploaded",
FeeDenied: "/fee-denied",
Fixtures: "/fixtures",
GettingHelpSigning: "/getting-help-signing",
Expand Down Expand Up @@ -295,6 +296,7 @@ var Paths = AppPaths{
NeedHelpSigningConfirmation: "/need-help-signing-confirmation",
PaymentConfirmation: "/payment-confirmation",
PreviousApplicationNumber: "/previous-application-number",
PreviousFee: "/how-much-did-you-previously-pay-for-your-lpa",
Progress: "/progress",
ProveYourIdentity: "/prove-your-identity",
ReadYourLpa: "/read-your-lpa",
Expand All @@ -313,8 +315,6 @@ var Paths = AppPaths{
UploadEvidence: "/upload-evidence",
UseExistingAddress: "/use-existing-address",
WhatACertificateProviderDoes: "/what-a-certificate-provider-does",
WhatHappensAfterNoFee: "/what-happens-after-no-fee",
PreviousFee: "/how-much-did-you-previously-pay-for-your-lpa",
WhenCanTheLpaBeUsed: "/when-can-the-lpa-be-used",
WhichFeeTypeAreYouApplyingFor: "/which-fee-type-are-you-applying-for",
WithdrawThisLpa: "/withdraw-this-lpa",
Expand Down
7 changes: 6 additions & 1 deletion lang/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -918,5 +918,10 @@
"halfFee": "Welsh",
"nothingExemption": "Welsh",
"nothingHardship": "Welsh",
"howMuchYouPreviouslyPaid": "Welsh"
"howMuchYouPreviouslyPaid": "Welsh",
"evidenceSuccessfullyUploaded": "Welsh",
"weWillReviewYourLpaApplicationAndSupportingEvidence": "<p class=\"govuk-body\">Welsh</p>",
"applicationNoFee": "welsh",
"applicationHalfFee": "welsh",
"applicationHardshipFee": "welsh"
}
9 changes: 7 additions & 2 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"errorSelect": "Select {{.Label}}",
"errorEmail": "{{.Label}} must be in the correct format, like [email protected]",
"errorPostcode": "{{.Label}} must be a UK postcode",
"errorReferenceNumber": "{{.Label}} must begin with 7 or M",
"errorReferenceNumber": "{{.Label}} must begin with the number 7 or the letter M",
"donorMatchesActorWarning": "The donor’s name is also {{.FirstNames}} {{.LastName}}. The donor cannot be {{.Type}}.",
"attorneyMatchesActorWarning": "There is also an attorney called {{.FirstNames}} {{.LastName}}. An attorney cannot be {{.Type}}.",
"attorneyMatchesAttorneyWarning": "There is already an attorney called {{.FirstNames}} {{.LastName}}.",
Expand Down Expand Up @@ -862,5 +862,10 @@
"halfFee": "£41 (half fee)",
"nothingExemption": "Nothing - I paid no fee because I got an exemption",
"nothingHardship": "Nothing - I paid no fee because I got a hardship fee waiver",
"howMuchYouPreviouslyPaid": "how much you previously paid"
"howMuchYouPreviouslyPaid": "how much you previously paid",
"evidenceSuccessfullyUploaded": "Evidence successfully uploaded",
"weWillReviewYourLpaApplicationAndSupportingEvidence": "<p class=\"govuk-body\">We will review your LPA application and supporting evidence.</p><h2 class=\"govuk-heading-m\">What happens next</h2><h3 class=\"govuk-heading-s\">Sign your LPA</h3><p class=\"govuk-body\">You can still sign your LPA while we’re reviewing your application. Your certificate provider must be there as a witness when you sign it.</p><p class=\"govuk-body\">However, we will not contact your certificate provider to provide their certificate until your {{.Application}} has been approved.</p><h3 class=\"govuk-heading-s\">If your application is successful</h3><p class=\"govuk-body\">Once we have approved your payment, we will contact your certificate provider to provide their certificate.</p><h3 class=\"govuk-heading-s\">If your application is not successful</h3><p class=\"govuk-body\">We will contact you if we need more information or if your application is unsuccessful.</p><details class=\"govuk-details\" data-module=\"govuk-details\"><summary class=\"govuk-details__summary\"><span class=\"govuk-details__summary-text\"> Appealing the decision </span></summary><div class=\"govuk-details__text\"><p class=\"govuk-body\">If your application is unsuccessful, you can appeal within 4 weeks of the decision by writing to the Head of Corporate Services.</p><p class=\"govuk-body\">If the original decision is upheld, it will be referred to the Public Guardian for confirmation.</p></div></details>",
"applicationNoFee": "application to pay no fee",
"applicationHalfFee": "application to pay a half fee",
"applicationHardshipFee": "hardship application"
}
19 changes: 19 additions & 0 deletions web/template/evidence_successfully_uploaded.gohtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{ template "page" . }}

{{ define "pageTitle" }}{{ tr .App "evidenceSuccessfullyUploaded" }}{{ end }}

{{ define "main" }}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title">{{ tr .App "evidenceSuccessfullyUploaded" }}</h1>
</div>

{{ trFormatHtml .App "weWillReviewYourLpaApplicationAndSupportingEvidence" "Application" (printf "application%s" .Lpa.FeeType.String | tr .App) }}

<div class="govuk-button-group">
<a class="govuk-button" href="{{ link .App (.App.Paths.TaskList.Format .App.LpaID) }}" data-module="govuk-button">{{ tr $.App "returnToTaskList" }}</a>
</div>
</div>
</div>
{{ end }}
6 changes: 3 additions & 3 deletions web/template/payment_confirmation.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
{{ trHtml .App "paymentConfirmationContent" }}

{{ if .FeeType.IsHalfFee }}
{{ trHtml .App "halfFeeNextSteps" }}
<a class="govuk-button" href="{{ link .App (.App.Paths.EvidenceSuccessfullyUploaded.Format .App.LpaID) }}">{{ tr .App "continue" }}</a>
{{ else }}
<a class="govuk-button" href="{{ link .App (.App.Paths.TaskList.Format .App.LpaID) }}">{{ tr .App "continue" }}</a>
{{ end }}

<a class="govuk-button" href="{{ link .App (.App.Paths.TaskList.Format .App.LpaID) }}">{{ tr .App "continue" }}</a>
</div>
</div>
{{ end }}
17 changes: 0 additions & 17 deletions web/template/what_happens_after_no_fee.gohtml

This file was deleted.

0 comments on commit 84fa277

Please sign in to comment.