Skip to content

Commit

Permalink
Show when personal welfare LPA can be used
Browse files Browse the repository at this point in the history
  • Loading branch information
hawx committed Oct 31, 2023
1 parent 5eeb895 commit 32b76ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions cypress/e2e/donor/check-your-lpa.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ describe('Check the LPA', () => {
cy.visit('/fixtures?redirect=/check-your-lpa&progress=peopleToNotifyAboutYourLpa');
});

it('cannot change when personal welfare LPA can be used', () => {
cy.visit('/fixtures?redirect=/check-your-lpa&progress=peopleToNotifyAboutYourLpa&lpa-type=hw');

cy.contains('.govuk-summary-list__row', 'When your attorneys can use your LPA')
.contains('Only when I do not have mental capacity')
.contains('Change').should('not.exist');
});

it("can submit the completed LPA", () => {
cy.contains('h1', "Check your LPA")

Expand Down
8 changes: 6 additions & 2 deletions web/template/layout/lpa-decisions.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@
{{ end }}
</dt>
<dd class="govuk-summary-list__value">
{{ tr .App .Lpa.WhenCanTheLpaBeUsed.String }}
{{ if .Lpa.Type.IsPropertyFinance }}
{{ tr .App .Lpa.WhenCanTheLpaBeUsed.String }}
{{ else if .Lpa.Type.IsHealthWelfare }}
{{ tr .App "when-capacity-lost" }}
{{ end }}
</dd>
{{ if $canChange }}
{{ if and $canChange .Lpa.Type.IsPropertyFinance }}
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="{{ link .App (.App.Paths.WhenCanTheLpaBeUsed.Format .App.LpaID) }}">
{{ tr .App "change" }}<span class="govuk-visually-hidden"> {{ tr .App "whenYourAttorneysCanUseYourLpa" }}</span>
Expand Down

0 comments on commit 32b76ad

Please sign in to comment.