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

Fpet 730 and FPET-827 #1486

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Prerequisites

Running the application requires the following tools to be installed in your environment:
Running the application requires the following tools to be installed in your environment

- [Node.js](https://nodejs.org/) v12.0.0 or later
- [yarn](https://yarnpkg.com/)
Expand Down
5 changes: 5 additions & 0 deletions src/main/steps/eligibility/cannot-apply/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
<span class="govuk-caption-l">{{section}}</span>
<h1 class="govuk-heading-l">{{ title }}</h1>
<p class="govuk-body govuk-!-margin-top-4">{{line1}}</p>
{% if language == 'en' %}
<a href="https://www.gov.uk/child-adoption" class="govuk-link">{{line2}}</a>
{% else %}
<a href="https://www.gov.uk/mabwysiadu-plentyn" class="govuk-link">{{line2}}</a>
{% endif %}


</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/steps/eligibility/domicile/content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('eligibility > domicile > content', () => {
expect((field.values[1].label as Function)(commonContent)).toBe(commonContent.no);
expect(field.values[1].value).toBe(YesNoNotsure.NO);
expect((field.values[1].conditionalText as Function)(generatedContent)).toBe(
'<p class="govuk-label">You cannot apply to adopt a child unless you have a permanent home here.</p> <p class="govuk-label"><a href="https://www.gov.uk/child-adoption" class="govuk-link">More about adoption</a></p>'
'<p class="govuk-label">You cannot apply to adopt a child unless you have a permanent home here.</p> <p class="govuk-label"><a href=https://www.gov.uk/child-adoption class="govuk-link">More about adoption</a></p>'
);
expect(field.validator).toBe(isFieldFilledIn);
});
Expand Down
4 changes: 3 additions & 1 deletion src/main/steps/eligibility/domicile/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const en = () => ({
domicileNo: 'You cannot apply to adopt a child unless you have a permanent home here.',
moreInfo: 'More about adoption',
continue: 'Continue',
url: 'https://www.gov.uk/child-adoption',
errors: {
domicileEligible: {
required:
Expand All @@ -26,6 +27,7 @@ const cy: typeof en = () => ({
domicileNo: 'Ni allwch wneud cais i fabwysiadu plentyn oni bai bod gennych gartref parhaol yma.',
moreInfo: 'Mwy o wybodaeth am fabwysiadu',
continue: 'Parhau',
url: 'https://www.gov.uk/mabwysiadu-plentyn',
yes: 'Ie',
no: 'Na',
errors: {
Expand All @@ -50,7 +52,7 @@ export const form: FormContent = {
label: l => l.no,
value: YesOrNo.NO,
conditionalText: l =>
`<p class="govuk-label">${l.domicileNo}</p> <p class="govuk-label"><a href="https://www.gov.uk/child-adoption" class="govuk-link">${l.moreInfo}</a></p>`,
`<p class="govuk-label">${l.domicileNo}</p> <p class="govuk-label"><a href=${l.url} class="govuk-link">${l.moreInfo}</a></p>`,
},
],
validator: isFieldFilledIn,
Expand Down
2 changes: 1 addition & 1 deletion src/main/steps/eligibility/lived-uk/content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('eligibility > lived-uk > content', () => {
expect((field.values[1].label as Function)(commonContent)).toBe(commonContent.no);
expect(field.values[1].value).toBe(YesNoNotsure.NO);
expect((field.values[1].conditionalText as Function)(generatedContent)).toBe(
'<p class="govuk-label">You cannot apply to adopt a child unless you have a permanent home here.</p> <p class="govuk-label"><a href="https://www.gov.uk/child-adoption" class="govuk-link">More about adoption</a></p>'
'<p class="govuk-label">You cannot apply to adopt a child unless you have a permanent home here.</p> <p class="govuk-label"><a href=https://www.gov.uk/child-adoption class="govuk-link">More about adoption</a></p>'
);
expect(field.validator).toBe(isFieldFilledIn);
});
Expand Down
4 changes: 3 additions & 1 deletion src/main/steps/eligibility/lived-uk/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const en = () => ({
livedUKNo: 'You cannot apply to adopt a child unless you have a permanent home here.',
moreInfo: 'More about adoption',
continue: 'Continue',
url: 'https://www.gov.uk/child-adoption',
errors: {
livedUKEligible: {
required:
Expand All @@ -26,6 +27,7 @@ const cy: typeof en = () => ({
livedUKNo: 'Ni allwch wneud cais i fabwysiadu plentyn oni bai bod gennych gartref parhaol yma.',
moreInfo: 'Mwy o wybodaeth am fabwysiadu',
continue: 'Parhau',
url: 'https://www.gov.uk/mabwysiadu-plentyn',
yes: 'Do',
no: 'Naddo',
errors: {
Expand All @@ -50,7 +52,7 @@ export const form: FormContent = {
label: l => l.no,
value: YesOrNo.NO,
conditionalText: l =>
`<p class="govuk-label">${l.livedUKNo}</p> <p class="govuk-label"><a href="https://www.gov.uk/child-adoption" class="govuk-link">${l.moreInfo}</a></p>`,
`<p class="govuk-label">${l.livedUKNo}</p> <p class="govuk-label"><a href=${l.url} class="govuk-link">${l.moreInfo}</a></p>`,
},
],
validator: isFieldFilledIn,
Expand Down
2 changes: 1 addition & 1 deletion src/main/steps/eligibility/married/content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('eligibility > married > content', () => {
expect((field.values[0].label as Function)(commonContent)).toBe(commonContent.yes);
expect(field.values[0].value).toBe(YesNoNotsure.YES);
expect((field.values[0].conditionalText as Function)(generatedContent)).toBe(
'<p class="govuk-label">You can only apply to adopt a child if they\'ve not been married or in a civil partnership.</p> <p class="govuk-label"><a rel="noreferrer noopener" href="https://www.gov.uk/child-adoption" class="govuk-link">More about adoption</a></p>'
'<p class="govuk-label">You can only apply to adopt a child if they\'ve not been married or in a civil partnership.</p> <p class="govuk-label"><a rel="noreferrer noopener" href=https://www.gov.uk/child-adoption class="govuk-link">More about adoption</a></p>'
);

expect((field.values[1].label as Function)(commonContent)).toBe(commonContent.no);
Expand Down
4 changes: 3 additions & 1 deletion src/main/steps/eligibility/married/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const en = () => ({
marriedYes: "You can only apply to adopt a child if they've not been married or in a civil partnership.",
moreInfo: 'More about adoption',
continue: 'Continue',
url: 'https://www.gov.uk/child-adoption',
errors: {
marriedEligible: {
required: 'Select if the child is married or in a civil partnership.',
Expand All @@ -25,6 +26,7 @@ const cy: typeof en = () => ({
marriedYes: 'Gallwch ond wneud cais i fabwysiadu plentyn os nad ydynt wedi priodi ac ddim mewn partneriaeth sifil.',
moreInfo: 'Mwy o wybodaeth am fabwysiadu',
continue: 'Parhau',
url: 'https://www.gov.uk/mabwysiadu-plentyn',
yes: 'Ydy',
no: 'Nac ydy',
errors: {
Expand All @@ -48,7 +50,7 @@ export const form: FormContent = {
label: l => l.yes,
value: YesOrNo.YES,
conditionalText: l =>
`<p class="govuk-label">${l.marriedYes}</p> <p class="govuk-label"><a rel="noreferrer noopener" href="https://www.gov.uk/child-adoption" class="govuk-link">${l.moreInfo}</a></p>`,
`<p class="govuk-label">${l.marriedYes}</p> <p class="govuk-label"><a rel="noreferrer noopener" href=${l.url} class="govuk-link">${l.moreInfo}</a></p>`,
},
{ label: l => l.no, value: YesOrNo.NO },
],
Expand Down
6 changes: 3 additions & 3 deletions src/main/steps/eligibility/start/content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ const enContent = {
line12:
"If you're applying for more than one child, you must submit a new application for each child. You will not be charged if you submit these before midnight on the day of your first application. If you submit after the day of the first application, you will be charged another £183. For this reason we recommend you begin the applications early and have everything you need.",
line13: 'You must sign in using the same email address and password used in your first application.',
startnow: 'Start now',
startnow: 'Continue',
};

const cyContent = {
title: 'Gwneud cais i fabwysiadu plentyn a osodwyd yn eich gofal',
line1:
'Gallwch wneud cais i fabwysiadu plentyn sydd yn eich gofal yn dilyn <a class="govuk-link" href="https://www.gov.uk/child-adoption/applying-for-an-adoption-court-order">gorchymyn lleoli gan y llys.</a>',
'Gallwch wneud cais i fabwysiadu plentyn sydd yn eich gofal yn dilyn <a class="govuk-link" href="https://www.gov.uk/mabwysiadu-plentyn/gwneud-cais-am-orchymyn-llys-mabwysiadu">gorchymyn lleoli gan y llys.</a>',
line2:
"Gallwch ddechrau eich cais ar unrhyw adeg fodd bynnag, mae'n rhaid i'r plentyn fod wedi byw gyda chi am o leiaf 10 wythnos cyn y gallwch gyflwyno’r cais.",
line3:
Expand All @@ -66,7 +66,7 @@ const cyContent = {
'Os ydych chi’n gwneud cais i fabwysiadu mwy nag un plentyn, mae’n rhaid i chi gyflwyno cais newydd ar gyfer pob plentyn. Ni chodir ffi arall arnoch os byddwch yn cyflwyno’r ceisiadau hyn cyn hanner nos ar ddyddiad cyflwyno’ch cais cyntaf. Os byddwch yn eu cyflwyno ar ôl dyddiad cyflwyno’r cais cyntaf, yna bydd rhaid i chi dalu £183 arall. Am y rheswm hwn, argymhellwn eich bod yn dechrau eich ceisiadau yn gynnar a bod gennych bopeth rydych ei angen wrth law.',
line13:
'Mae’n rhaid ichi fewngofnodi gan ddefnyddio’r un cyfeiriad e-bost a chyfrinair a ddefnyddiwyd ar gyfer eich cais cyntaf.',
startnow: 'Dechrau nawr',
startnow: 'Parhau',
};

describe('eligibility > start > content', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/main/steps/eligibility/start/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ const en = content => ({
line12:
"If you're applying for more than one child, you must submit a new application for each child. You will not be charged if you submit these before midnight on the day of your first application. If you submit after the day of the first application, you will be charged another £183. For this reason we recommend you begin the applications early and have everything you need.",
line13: 'You must sign in using the same email address and password used in your first application.',
startnow: 'Start now',
startnow: 'Continue',
});

const cy: typeof en = () => ({
title: 'Gwneud cais i fabwysiadu plentyn a osodwyd yn eich gofal',
line1:
'Gallwch wneud cais i fabwysiadu plentyn sydd yn eich gofal yn dilyn <a class="govuk-link" href="https://www.gov.uk/child-adoption/applying-for-an-adoption-court-order">gorchymyn lleoli gan y llys.</a>',
'Gallwch wneud cais i fabwysiadu plentyn sydd yn eich gofal yn dilyn <a class="govuk-link" href="https://www.gov.uk/mabwysiadu-plentyn/gwneud-cais-am-orchymyn-llys-mabwysiadu">gorchymyn lleoli gan y llys.</a>',
line2:
"Gallwch ddechrau eich cais ar unrhyw adeg fodd bynnag, mae'n rhaid i'r plentyn fod wedi byw gyda chi am o leiaf 10 wythnos cyn y gallwch gyflwyno’r cais.",
line3:
Expand All @@ -60,7 +60,7 @@ const cy: typeof en = () => ({
'Os ydych chi’n gwneud cais i fabwysiadu mwy nag un plentyn, mae’n rhaid i chi gyflwyno cais newydd ar gyfer pob plentyn. Ni chodir ffi arall arnoch os byddwch yn cyflwyno’r ceisiadau hyn cyn hanner nos ar ddyddiad cyflwyno’ch cais cyntaf. Os byddwch yn eu cyflwyno ar ôl dyddiad cyflwyno’r cais cyntaf, yna bydd rhaid i chi dalu £183 arall. Am y rheswm hwn, argymhellwn eich bod yn dechrau eich ceisiadau yn gynnar a bod gennych bopeth rydych ei angen wrth law.',
line13:
'Mae’n rhaid ichi fewngofnodi gan ddefnyddio’r un cyfeiriad e-bost a chyfrinair a ddefnyddiwyd ar gyfer eich cais cyntaf.',
startnow: 'Dechrau nawr',
startnow: 'Parhau',
});

const languages = {
Expand Down
4 changes: 3 additions & 1 deletion src/main/steps/eligibility/start/template.njk
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% from "govuk/components/inset-text/macro.njk" import govukInsetText %}
{% extends "common/page.njk" %}
{% block content %}

Expand All @@ -8,7 +9,8 @@

<h1 class="govuk-heading-xl">{{ title }}</h1>

<p class="govuk-body">{{ line1 | safe }}</p>
{{ govukInsetText( {text: line1 | safe }) }}

<p class="govuk-body">{{ line2 }}</p>
<p class="govuk-body">{{ line3 }}</p>

Expand Down
2 changes: 1 addition & 1 deletion src/main/steps/eligibility/under-18/content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('eligibility > under-18 > content', () => {
expect((field.values[1].label as Function)(commonContent)).toBe(commonContent.no);
expect(field.values[1].value).toBe(YesNoNotsure.NO);
expect((field.values[1].conditionalText as Function)(generatedContent)).toBe(
'<p class="govuk-label">You can only apply to adopt a child if they are under 18 years old on the date your application is submitted.</p> <p class="govuk-label"><a href="https://www.gov.uk/child-adoption" class="govuk-link">More about adoption</a></p>'
'<p class="govuk-label">You can only apply to adopt a child if they are under 18 years old on the date your application is submitted.</p> <p class="govuk-label"><a href=https://www.gov.uk/child-adoption class="govuk-link">More about adoption</a></p>'
);
expect(field.validator).toBe(isFieldFilledIn);
});
Expand Down
4 changes: 3 additions & 1 deletion src/main/steps/eligibility/under-18/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const en = () => ({
'You can only apply to adopt a child if they are under 18 years old on the date your application is submitted.',
moreInfo: 'More about adoption',
continue: 'Continue',
url: 'https://www.gov.uk/child-adoption',
errors: {
under18Eligible: {
required: 'Select if the child will be under 18 years old on the date you submit your application.',
Expand All @@ -24,6 +25,7 @@ const cy: typeof en = () => ({
under18No: 'Gallwch ond mabwysiadu plentyn os ydynt dan 18 oed ar y dyddiad mae eich cais yn cael ei gyflwyno.',
moreInfo: 'Mwy o wybodaeth am fabwysiadu',
continue: 'Parhau',
url: 'https://www.gov.uk/mabwysiadu-plentyn',
yes: 'Bydd',
no: 'Na fydd',
errors: {
Expand All @@ -47,7 +49,7 @@ export const form: FormContent = {
label: l => l.no,
value: YesOrNo.NO,
conditionalText: l =>
`<p class="govuk-label">${l.under18No}</p> <p class="govuk-label"><a href="https://www.gov.uk/child-adoption" class="govuk-link">${l.moreInfo}</a></p>`,
`<p class="govuk-label">${l.under18No}</p> <p class="govuk-label"><a href=${l.url} class="govuk-link">${l.moreInfo}</a></p>`,
},
],
validator: isFieldFilledIn,
Expand Down
2 changes: 1 addition & 1 deletion src/main/steps/eligibility/under-21/content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('eligibility > under-21 > content', () => {
expect((field.values[1].label as Function)(commonContent)).toBe(commonContent.no);
expect(field.values[1].value).toBe(YesNoNotsure.NO);
expect((field.values[1].conditionalText as Function)(generatedContent)).toBe(
'<p class="govuk-label">You must be 21 or over to adopt a child. This includes any other applicant.</p> <p class="govuk-label"><a href="https://www.gov.uk/child-adoption" class="govuk-link">More about adoption</a></p>'
'<p class="govuk-label">You must be 21 or over to adopt a child. This includes any other applicant.</p> <p class="govuk-label"><a href=https://www.gov.uk/child-adoption class="govuk-link">More about adoption</a></p>'
);
expect(field.validator).toBe(isFieldFilledIn);
});
Expand Down
4 changes: 3 additions & 1 deletion src/main/steps/eligibility/under-21/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const en = () => ({
under21Yes: 'You must be 21 or over to adopt a child. This includes any other applicant.',
moreInfo: 'More about adoption',
continue: 'Continue',
url: 'https://www.gov.uk/child-adoption',
errors: {
under21Eligible: {
required: 'Select if you, and the other applicant if relevant, are both aged 21 or over.',
Expand All @@ -23,6 +24,7 @@ const cy: typeof en = () => ({
under21Yes: 'Rhaid i chi fod yn 21 oed o leiaf i fabwysiadu plentyn. Mae hyn yn cynnwys unrhyw geisydd arall.',
moreInfo: 'Mwy o wybodaeth am fabwysiadu',
continue: 'Parhau',
url: 'https://www.gov.uk/mabwysiadu-plentyn',
yes: 'Ydy',
no: 'Nac ydy',
errors: {
Expand All @@ -46,7 +48,7 @@ export const form: FormContent = {
label: l => l.no,
value: YesOrNo.NO,
conditionalText: l =>
`<p class="govuk-label">${l.under21Yes}</p> <p class="govuk-label"><a href="https://www.gov.uk/child-adoption" class="govuk-link">${l.moreInfo}</a></p>`,
`<p class="govuk-label">${l.under21Yes}</p> <p class="govuk-label"><a href=${l.url} class="govuk-link">${l.moreInfo}</a></p>`,
},
],
validator: isFieldFilledIn,
Expand Down
2 changes: 1 addition & 1 deletion src/test/e2e/pages/login.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
async signInFromEligibility() {
await I.retry(3).goToPage(config.baseUrl + 'eligibility/start');
await I.wait(4);
await I.retry(3).click('Start now');
await I.retry(3).click('Continue');
await I.wait(4);
await I.retry(3).see('Are you applying to adopt more than one child?');
await I.retry(3).click('Continue');
Expand Down
Loading