Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLPAB-2692: Allow changing details after a failed vouch #1694

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions cypress/e2e/donor/confirm-your-identity.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ describe('Confirm your identity', () => {
});

it('can be completed ', () => {
cy.visitLpa("/your-details");

cy.contains('dt', 'First names').parent().contains('a', 'Change');
cy.contains('dt', 'Last name').parent().contains('a', 'Change');
cy.contains('dt', 'Date of birth').parent().contains('a', 'Change');

cy.contains('a', 'Return to task list').click();

cy.contains('li', "Confirm your identity")
.should('contain', 'Not started')
.find('a')
Expand All @@ -25,6 +33,12 @@ describe('Confirm your identity', () => {
cy.contains('a', 'Return to task list').click();

cy.url().should('contain', '/task-list');

cy.visitLpa("/your-details");

cy.contains('dt', 'First names').parent().should('not.contain', 'Change');
cy.contains('dt', 'Last name').parent().should('not.contain', 'Change');
cy.contains('dt', 'Date of birth').parent().should('not.contain', 'Change');
});
});

Expand Down Expand Up @@ -254,6 +268,40 @@ describe('Confirm your identity', () => {
.should('contain', 'Pending')
.find('a')
.click();

cy.visitLpa("/your-details");

cy.contains('dt', 'First names').parent().contains('a', 'Change');
cy.contains('dt', 'Last name').parent().contains('a', 'Change');
cy.contains('dt', 'Date of birth').parent().contains('a', 'Change');
});
});

describe('when has invited a voucher to confirm identity', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/task-list&progress=confirmYourIdentity&idStatus=donor:insufficient-evidence&voucher=1');
});

it('cannot update name or date of birth', () => {
cy.visitLpa("/your-details");

cy.contains('dt', 'First names').parent().should('not.contain', 'Change');
cy.contains('dt', 'Last name').parent().should('not.contain', 'Change');
cy.contains('dt', 'Date of birth').parent().should('not.contain', 'Change');
})
})

describe('when a voucher has been unable to vouch', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/task-list&progress=confirmYourIdentity&idStatus=donor:insufficient-evidence&failedVouchAttempts=1');
});

it('can update name and date of birth', () => {
cy.visitLpa("/your-details");

cy.contains('dt', 'First names').parent().should('contain', 'Change');
cy.contains('dt', 'Last name').parent().should('contain', 'Change');
cy.contains('dt', 'Date of birth').parent().should('contain', 'Change');
})
})
});
1 change: 1 addition & 0 deletions internal/page/fixtures/donor.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ func updateLPAProgress(
userData = identity.UserData{
Status: identity.StatusInsufficientEvidence,
}
donorDetails.Tasks.ConfirmYourIdentity = task.IdentityStateInProgress
case "expired":
userData = identity.UserData{
Status: identity.StatusExpired,
Expand Down
15 changes: 10 additions & 5 deletions web/template/donor/your_details.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{{ define "pageTitle" }}{{ tr .App "yourDetails" }}{{ end }}

{{ define "main" }}
{{ $hasNoIdentity := and .Donor.IdentityUserData.Status.IsUnknown .Donor.CanChange }}
{{ $vouchInProgress := and .Donor.IdentityUserData.Status.IsInsufficientEvidence .Donor.Voucher.FirstNames }}
{{ $canChange := and .Donor.CanChange (not (or .Donor.IdentityUserData.Status.IsConfirmed $vouchInProgress)) }}

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
Expand All @@ -14,17 +15,17 @@
{{ template "summary-row" (summaryRow .App "firstNames"
.Donor.Donor.FirstNames
(fromLink .App global.Paths.YourName "#f-first-names")
.Donor.Donor.FullName $hasNoIdentity true) }}
.Donor.Donor.FullName $canChange true) }}

{{ template "summary-row" (summaryRow .App "lastName"
.Donor.Donor.LastName
(fromLink .App global.Paths.YourName "#f-last-name")
.Donor.Donor.FullName $hasNoIdentity true) }}
.Donor.Donor.FullName $canChange true) }}

{{ template "summary-row" (summaryRow .App "dateOfBirth"
(formatDate .App .Donor.Donor.DateOfBirth)
(fromLink .App global.Paths.YourDateOfBirth "#f-date-of-birth")
.Donor.Donor.FullName $hasNoIdentity true) }}
.Donor.Donor.FullName $canChange true) }}

{{ template "address-summary-row" (summaryRow $.App "address"
.Donor.Donor.Address
Expand All @@ -42,10 +43,14 @@
.Donor.Donor.FullName .Donor.CanChange true) }}
</dl>

{{ if not $hasNoIdentity }}
{{ if .Donor.IdentityUserData.Status.IsConfirmed }}
<p class="govuk-inset-text">{{ tr .App "someOfTheseDetailsCanNoLongerBeChanged" }}</p>
{{ end }}

{{ if $vouchInProgress }}
<p class="govuk-inset-text">{{ tr .App "Placeholder text to show details cannot be updated while a voucher is confirming the donor’s identity" }}</p>
{{ end }}

{{ template "buttons" (button .App "continue" "link" (global.Paths.CanYouSignYourLpa.Format .App.LpaID)) }}
{{ template "csrf-field" . }}
</form>
Expand Down
Loading