Skip to content

Commit

Permalink
Merge pull request #1600 from ministryofjustice/MLPAB-2560-voucher-co…
Browse files Browse the repository at this point in the history
…ntent

MLPAB-2560 Update content for donor choosing a voucher
  • Loading branch information
hawx authored Nov 5, 2024
2 parents a103194 + 28af40d commit 070c298
Show file tree
Hide file tree
Showing 15 changed files with 85 additions and 87 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
describe('what is vouching', () => {
describe('Choose someone to vouch for you', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/what-is-vouching&progress=payForTheLpa')
cy.url().should('contain', '/what-is-vouching')
cy.visit('/fixtures?redirect=/choose-someone-to-vouch-for-you&progress=payForTheLpa')
cy.url().should('contain', '/choose-someone-to-vouch-for-you')
cy.checkA11yApp()
})

it('errors when option not selected', () => {
cy.contains('button', 'Save and continue').click();

cy.url().should('contain', '/what-is-vouching')
cy.url().should('contain', '/choose-someone-to-vouch-for-you')
cy.checkA11yApp()

cy.get('.govuk-error-summary').within(() => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/donor/confirm-your-identity.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Confirm your identity', () => {
cy.checkA11yApp();
cy.contains('a', 'Continue').click();

cy.url().should('contain', '/what-is-vouching');
cy.url().should('contain', '/choose-someone-to-vouch-for-you');
cy.checkA11yApp();
})
})
Expand Down
6 changes: 1 addition & 5 deletions cypress/e2e/donor/enter-voucher.cy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
describe('Enter voucher', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/what-is-vouching&progress=payForTheLpa');
cy.get('input[name="yes-no"]').check('yes', { force: true });
cy.contains('button', 'Save and continue').click();

cy.url().should('contain', '/enter-voucher')
cy.visit('/fixtures?redirect=/enter-voucher&progress=payForTheLpa');
});

it('adds a voucher', () => {
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/donor/what-you-can-do-now.cy.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
describe('what you can do now', () => {
context('donor failed ID check', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/what-is-vouching&progress=confirmYourIdentity&idStatus=donor:insufficient-evidence')
cy.url().should('contain', '/what-is-vouching')
cy.visit('/fixtures?redirect=/choose-someone-to-vouch-for-you&progress=confirmYourIdentity&idStatus=donor:insufficient-evidence')
cy.url().should('contain', '/choose-someone-to-vouch-for-you')
cy.checkA11yApp()

cy.get('input[name="yes-no"]').check('no', { force: true });
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('what you can do now', () => {

context('want a different voucher', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/what-is-vouching&progress=payForTheLpa');
cy.visit('/fixtures?redirect=/choose-someone-to-vouch-for-you&progress=payForTheLpa');
cy.get('input[name="yes-no"]').check('yes', { force: true });
cy.contains('button', 'Save and continue').click();
cy.get('#f-first-names').type('Shopping');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import (
"github.com/ministryofjustice/opg-modernising-lpa/internal/validation"
)

type whatIsVouchingData struct {
type chooseSomeoneToVouchForYouData struct {
App appcontext.Data
Errors validation.List
Form *form.YesNoForm
}

func WhatIsVouching(tmpl template.Template, donorStore DonorStore) Handler {
func ChooseSomeoneToVouchForYou(tmpl template.Template, donorStore DonorStore) Handler {
return func(appData appcontext.Data, w http.ResponseWriter, r *http.Request, provided *donordata.Provided) error {
data := &whatIsVouchingData{
data := &chooseSomeoneToVouchForYouData{
App: appData,
Form: form.NewYesNoForm(provided.WantVoucher),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import (
"github.com/stretchr/testify/mock"
)

func TestGetWhatIsVouching(t *testing.T) {
func TestGetChooseSomeoneToVouchForYou(t *testing.T) {
w := httptest.NewRecorder()
r := httptest.NewRequest(http.MethodGet, "/", nil)

template := newMockTemplate(t)
template.EXPECT().
Execute(w, &whatIsVouchingData{
Execute(w, &chooseSomeoneToVouchForYouData{
App: testAppData,
Form: &form.YesNoForm{
YesNo: form.Yes,
Expand All @@ -31,12 +31,12 @@ func TestGetWhatIsVouching(t *testing.T) {
}).
Return(nil)

err := WhatIsVouching(template.Execute, nil)(testAppData, w, r, &donordata.Provided{WantVoucher: form.Yes})
err := ChooseSomeoneToVouchForYou(template.Execute, nil)(testAppData, w, r, &donordata.Provided{WantVoucher: form.Yes})

assert.Nil(t, err)
}

func TestGetWhatIsVouchingWhenTemplateError(t *testing.T) {
func TestGetChooseSomeoneToVouchForYouWhenTemplateError(t *testing.T) {
w := httptest.NewRecorder()
r := httptest.NewRequest(http.MethodGet, "/", nil)

Expand All @@ -45,12 +45,12 @@ func TestGetWhatIsVouchingWhenTemplateError(t *testing.T) {
Execute(mock.Anything, mock.Anything).
Return(expectedError)

err := WhatIsVouching(template.Execute, nil)(testAppData, w, r, &donordata.Provided{})
err := ChooseSomeoneToVouchForYou(template.Execute, nil)(testAppData, w, r, &donordata.Provided{})

assert.Error(t, err)
}

func TestPostWhatIsVouching(t *testing.T) {
func TestPostChooseSomeoneToVouchForYou(t *testing.T) {
testcases := map[form.YesNo]string{
form.Yes: donor.PathEnterVoucher.Format("lpa-id"),
form.No: donor.PathWhatYouCanDoNow.Format("lpa-id"),
Expand All @@ -74,7 +74,7 @@ func TestPostWhatIsVouching(t *testing.T) {
}).
Return(nil)

err := WhatIsVouching(nil, donorStore)(testAppData, w, r, &donordata.Provided{LpaID: "lpa-id"})
err := ChooseSomeoneToVouchForYou(nil, donorStore)(testAppData, w, r, &donordata.Provided{LpaID: "lpa-id"})
resp := w.Result()

assert.Nil(t, err)
Expand All @@ -84,7 +84,7 @@ func TestPostWhatIsVouching(t *testing.T) {
}
}

func TestPostWhatIsVouchingWhenDonorStoreError(t *testing.T) {
func TestPostChooseSomeoneToVouchForYouWhenDonorStoreError(t *testing.T) {
f := url.Values{
"yes-no": {form.Yes.String()},
}
Expand All @@ -98,7 +98,7 @@ func TestPostWhatIsVouchingWhenDonorStoreError(t *testing.T) {
Put(mock.Anything, mock.Anything).
Return(expectedError)

err := WhatIsVouching(nil, donorStore)(testAppData, w, r, &donordata.Provided{LpaID: "lpa-id"})
err := ChooseSomeoneToVouchForYou(nil, donorStore)(testAppData, w, r, &donordata.Provided{LpaID: "lpa-id"})
resp := w.Result()

assert.Error(t, err)
Expand Down
4 changes: 2 additions & 2 deletions internal/donor/donorpage/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ func Register(

handleWithDonor(donor.PathUnableToConfirmIdentity, page.None,
Guidance(tmpls.Get("unable_to_confirm_identity.gohtml")))
handleWithDonor(donor.PathWhatIsVouching, page.CanGoBack,
WhatIsVouching(tmpls.Get("what_is_vouching.gohtml"), donorStore))
handleWithDonor(donor.PathChooseSomeoneToVouchForYou, page.CanGoBack,
ChooseSomeoneToVouchForYou(tmpls.Get("choose_someone_to_vouch_for_you.gohtml"), donorStore))
handleWithDonor(donor.PathEnterVoucher, page.CanGoBack,
EnterVoucher(tmpls.Get("enter_voucher.gohtml"), donorStore, actoruid.New))
handleWithDonor(donor.PathConfirmPersonAllowedToVouch, page.CanGoBack,
Expand Down
2 changes: 1 addition & 1 deletion internal/donor/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const (
PathWhatACertificateProviderDoes = Path("/what-a-certificate-provider-does")
PathWhatHappensNextPostEvidence = Path("/what-happens-next-post-evidence")
PathWhatHappensNextRegisteringWithCourtOfProtection = Path("/what-happens-next-registering-with-court-of-protection")
PathWhatIsVouching = Path("/what-is-vouching")
PathChooseSomeoneToVouchForYou = Path("/choose-someone-to-vouch-for-you")
PathWhatYouCanDoNow = Path("/what-you-can-do-now")
PathWhatYouCanDoNowExpired = Path("/what-you-can-do-now-expired")
PathWhenCanTheLpaBeUsed = Path("/when-can-the-lpa-be-used")
Expand Down
4 changes: 2 additions & 2 deletions internal/templatefn/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ type appPaths struct {
WhatACertificateProviderDoes donor.Path
WhatHappensNextPostEvidence donor.Path
WhatHappensNextRegisteringWithCourtOfProtection donor.Path
WhatIsVouching donor.Path
ChooseSomeoneToVouchForYou donor.Path
WhatYouCanDoNow donor.Path
WhenCanTheLpaBeUsed donor.Path
WhichFeeTypeAreYouApplyingFor donor.Path
Expand Down Expand Up @@ -447,7 +447,7 @@ var paths = appPaths{
WhatACertificateProviderDoes: donor.PathWhatACertificateProviderDoes,
WhatHappensNextPostEvidence: donor.PathWhatHappensNextPostEvidence,
WhatHappensNextRegisteringWithCourtOfProtection: donor.PathWhatHappensNextRegisteringWithCourtOfProtection,
WhatIsVouching: donor.PathWhatIsVouching,
ChooseSomeoneToVouchForYou: donor.PathChooseSomeoneToVouchForYou,
WhatYouCanDoNow: donor.PathWhatYouCanDoNow,
WhenCanTheLpaBeUsed: donor.PathWhenCanTheLpaBeUsed,
WhichFeeTypeAreYouApplyingFor: donor.PathWhichFeeTypeAreYouApplyingFor,
Expand Down
12 changes: 7 additions & 5 deletions lang/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1240,21 +1240,20 @@
"youHaveEnteredNameWhichMatches": "Welsh {{.ActorType}}, {{.FullName}}.",
"personVouchingCannotBe": "<p class=\"govuk-body govuk-!-font-weight-bold\">Ni all yr unigolyn sy’n tystio drosoch chi fod:</p><ul class=\"govuk-list govuk-list--bullet\"><li>yn rhywun sydd wedi’i enwi yn eich LPA, yn cynnwys chi’ch hun</li><li>mewn perthynas â chi</li><li>yn aelod o’ch teulu</li><li>yn byw yn yr un cyfeiriad â chi</li></ul>",
"areYouSureThisPersonIsAllowedToVouchForYou": "Ydych chi’n siŵr bod yr unigolyn hwn yn cael tystio drosoch chi?",
"noINeedToChooseSomeoneElse": "Na, mae angen i mi ddewis rhywun arall",
"youCanChooseSomeoneElseToVouchForYou": "Welsh",
"yesIfPersonIsAllowedToVouchForYou": "ydw, os oes gan yr unigolyn hawl i dystio drosoch chi",
"important": "Pwysig",
"thePersonYouHaveChosenHasSameSurname": "Mae gan yr unigolyn rydych chi wedi’i ddewis i gadarnhau pwy ydych chi yr un cyfenw â chi.",
"checkYourDetails": "Gwirio eich manylion",
"weWillShareYourDetailsWithVoucher": "Byddwn yn rhannu eich manylion ac yn gofyn i’r person sy’n tystio drosoch chi eu dilysu.",
"checkYourDetailsAreCorrectBeforeYouContinue": "Cadarnhewch fod eich manylion yn gywir cyn parhau.",
"weWillShareYourDetailsWithVoucher": "Byddwn yn rhannu eich manylion ac yn gofyn i’r sawl sy’n tystio drosoch chi eu dilysu.",
"youHaveBeenUnableToConfirmYourIdentity": "Dydych chi ddim wedi gallu cadarnhau pwy ydych chi drwy ddefnyddio GOV.UK One Login.",
"vouchingLandingPageContent": "<p class=\"govuk-body\">Mae angen i chi gadarnhau pwy ydych chi cyn y gall Swyddfa’r Gwarcheidwad Cyhoeddus gofrestru eich atwrneiaeth arhosol.</p> <p class=\"govuk-body\">Gallwch naill ai:</p> <ul class=\"govuk-list govuk-list--bullet\"> <li>mynd yn ôl i GOV.UK One Login a cheisio cadarnhau pwy ydych chi eto</li> <li>gofyn i rywun rydych chi’n ei adnabod gadarnhau pwy ydych chi drwy dystio drosoch chi</li> </ul> <p class=\"govuk-body\">Bwrw ymlaen i gael gwybodaeth am dystio dros rywun a phwy sy’n cael cadarnhau pwy ydych chi.</p>",
"payingNoFee": "talu dim ffi (esemptiad)",
"payingHalfFee": "talu hanner ffi (gostyngiad)",
"aRepeatApplicationDiscount": "disgownt am ail gais",
"aHardshipApplication": "cais caledi (ildio ffi)",
"whatIsVouching": "Beth yw tystio dros rywun?",
"whatIsVouchingContent": "<p class=\"govuk-body\">Mae’r broses o dystio dros rywun yn caniatáu i rywun rydych chi’n ei adnabod yn dda gadarnhau pwy ydych chi.</p><h2 class=\"govuk-heading-s\">Pwy all dystio drosoch chi?</h2><p class=\"govuk-body\">Rhaid i’r unigolyn sy’n tystio drosoch chi fodloni’r meini prawf canlynol:</p><ul class=\"govuk-list govuk-list--bullet\"><li>bod yn 18 oed neu’n hŷn</li><li>gallu cadarnhau pwy ydyn nhw</li><li>eich adnabod ers o leiaf 2 flynedd</li><li>bod yn fodlon llofnodi datganiad</li></ul><h2 class=\"govuk-heading-s\">Pwy na all dystio drosoch chi?</h2><p class=\"govuk-body\">Ni all yr unigolyn rydych chi’n ei ddewis fod:</p><ul class=\"govuk-list govuk-list--bullet\"><li>yn rhywun sydd wedi’i enwi ar eich LPA, gan gynnwys chi’ch hun</li><li>mewn perthynas â chi</li><li>yn aelod o’ch teulu</li><li>yn byw yn yr un cyfeiriad â chi</li></ul><h2 class=\"govuk-heading-s\">Sut bydd yr unigolyn yn tystio drosoch chi?</h2><p class=\"govuk-body\">Rhaid i chi ofyn i’r unigolyn a yw’n fodlon tystio drosoch chi yn gyntaf. Os ydynt yn fodlon, bydd angen iddynt gadarnhau pwy ydynt gan ddefnyddio GOV.UK One Login.</p><p class=\"govuk-body\">Bydd angen iddynt gael naill ai:</p><ul class=\"govuk-list govuk-list--bullet\"><li>rhif Yswiriant Gwladol</li><li>pasbort y DU</li><li>trwydded yrru’r DU</li></ul><p class=\"govuk-body\">Byddwn wedyn yn gofyn iddynt lofnodi datganiad a chadarnhau pwy ydych chi.</p>",
"chooseSomeoneToVouchForYouContent": "<p class=\"govuk-body\">Welsh</p>",
"isThereSomeoneWhoCanVouchForYou": "Oes rhywun a all dystio drosoch chi?",
"yesIKnowSomeone": "Oes, rydw i’n adnabod rhywun ac maen nhw wedi cytuno i dystio drosof i",
"noIDoNotKnowSomeone": "Nac oes, dydw i ddim yn adnabod neb arall all dystio drostaf",
Expand Down Expand Up @@ -1462,5 +1461,8 @@
"youHaveChosen:prove-own-identity": "Welsh",
"youHaveChosen:select-new-voucher": "Welsh",
"youHaveChosen:withdraw-lpa": "Welsh",
"youHaveChosen:apply-to-cop": "Welsh"
"youHaveChosen:apply-to-cop": "Welsh",
"confirmYourIdentityThroughVouching": "Welsh",
"chooseSomeoneToVouchForYou": "Welsh",
"pleaseReviewTheInformationYouHaveEntered": "Welsh"
}
Loading

0 comments on commit 070c298

Please sign in to comment.