From 32b76adf75bb802e02ac7fca44d8912126bf50ff Mon Sep 17 00:00:00 2001 From: Joshua Hawxwell Date: Tue, 31 Oct 2023 09:47:53 +0000 Subject: [PATCH] Show when personal welfare LPA can be used --- cypress/e2e/donor/check-your-lpa.cy.js | 8 ++++++++ web/template/layout/lpa-decisions.gohtml | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/donor/check-your-lpa.cy.js b/cypress/e2e/donor/check-your-lpa.cy.js index c4e2d75f80..baaef95556 100644 --- a/cypress/e2e/donor/check-your-lpa.cy.js +++ b/cypress/e2e/donor/check-your-lpa.cy.js @@ -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") diff --git a/web/template/layout/lpa-decisions.gohtml b/web/template/layout/lpa-decisions.gohtml index 0414ab6d1d..b3f4251f92 100644 --- a/web/template/layout/lpa-decisions.gohtml +++ b/web/template/layout/lpa-decisions.gohtml @@ -31,9 +31,13 @@ {{ end }}
- {{ 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 }}
- {{ if $canChange }} + {{ if and $canChange .Lpa.Type.IsPropertyFinance }}
{{ tr .App "change" }} {{ tr .App "whenYourAttorneysCanUseYourLpa" }}