Skip to content

Commit

Permalink
Merge 3b1ad75 into 1c37a1d
Browse files Browse the repository at this point in the history
  • Loading branch information
acsauk authored Dec 20, 2023
2 parents 1c37a1d + 3b1ad75 commit eb214b5
Show file tree
Hide file tree
Showing 46 changed files with 479 additions and 139 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/certificate-provider/enter-date-of-birth.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Enter date of birth', () => {
cy.contains('button', 'Save and continue').click();

cy.url().should('contain', '/enter-date-of-birth');
cy.contains('By saving this section, you confirm that the person is more than 100 years old')
cy.contains('By continuing, you confirm that this person is more than 100 years old. If not, please change their date of birth.')

cy.checkA11yApp();

Expand Down
42 changes: 41 additions & 1 deletion cypress/e2e/donor/choose-attorneys.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,47 @@ describe('Choose attorneys', () => {
cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-attorneys');

cy.contains('The donor’s name is also Sam Smith.');
cy.contains('The donor’s name is also Sam Smith. The donor cannot also be an attorney. By saving this section, you are confirming that these are two different people with the same name.');

cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-attorneys-address');
});

it('permanently warns when date of birth is under 18', () => {
cy.visit('/fixtures?redirect=/choose-replacement-attorneys&progress=provideYourDetails');

cy.get('#f-first-names').type('John');
cy.get('#f-last-name').type('Doe');
cy.get('#f-date-of-birth').type('1');
cy.get('#f-date-of-birth-month').type('2');
cy.get('#f-date-of-birth-year').type(new Date().getFullYear());
cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-replacement-attorneys');

cy.contains('This attorney is under 18 years old. You can continue making your LPA but you will not be able to sign it until they are 18.');

cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-replacement-attorneys-address');

cy.visitLpa("/choose-replacement-attorneys-summary")
cy.contains('a', 'Change').click()
cy.url().should('contain', '/choose-replacement-attorneys');

cy.contains('This attorney is under 18 years old. You can continue making your LPA but you will not be able to sign it until they are 18.');
});

it('warns when date of birth is over 100', () => {
cy.visit('/fixtures?redirect=/choose-attorneys&progress=provideYourDetails');

cy.get('#f-first-names').type('John');
cy.get('#f-last-name').type('Doe');
cy.get('#f-date-of-birth').type('1');
cy.get('#f-date-of-birth-month').type('2');
cy.get('#f-date-of-birth-year').type('1900');
cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-attorneys');

cy.contains('By continuing, you confirm that this person is more than 100 years old. If not, please change their date of birth.');

cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-attorneys-address');
Expand Down
42 changes: 41 additions & 1 deletion cypress/e2e/donor/choose-replacement-attorneys.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,47 @@ describe('Choose replacement attorneys', () => {
cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-replacement-attorneys');

cy.contains('The donor’s name is also Sam Smith.');
cy.contains('The donor’s name is also Sam Smith. The donor cannot also be a replacement attorney. By saving this section, you are confirming that these are two different people with the same name.');

cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-replacement-attorneys-address');
});

it('permanently warns when date of birth is under 18', () => {
cy.visit('/fixtures?redirect=/choose-replacement-attorneys&progress=provideYourDetails');

cy.get('#f-first-names').type('John');
cy.get('#f-last-name').type('Doe');
cy.get('#f-date-of-birth').type('1');
cy.get('#f-date-of-birth-month').type('2');
cy.get('#f-date-of-birth-year').type(new Date().getFullYear());
cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-replacement-attorneys');

cy.contains('This attorney is under 18 years old. You can continue making your LPA but you will not be able to sign it until they are 18.');

cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-replacement-attorneys-address');

cy.visitLpa("/choose-replacement-attorneys-summary")
cy.contains('a', 'Change').click()
cy.url().should('contain', '/choose-replacement-attorneys');

cy.contains('This attorney is under 18 years old. You can continue making your LPA but you will not be able to sign it until they are 18.');
});

it('warns when date of birth is over 100', () => {
cy.visit('/fixtures?redirect=/choose-replacement-attorneys&progress=provideYourDetails');

cy.get('#f-first-names').type('John');
cy.get('#f-last-name').type('Doe');
cy.get('#f-date-of-birth').type('1');
cy.get('#f-date-of-birth-month').type('2');
cy.get('#f-date-of-birth-year').type('1900');
cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-replacement-attorneys');

cy.contains('By continuing, you confirm that this person is more than 100 years old. If not, please change their date of birth.');

cy.contains('button', 'Save and continue').click();
cy.url().should('contain', '/choose-replacement-attorneys-address');
Expand Down
40 changes: 39 additions & 1 deletion cypress/e2e/donor/your-details.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,48 @@ describe('Donor details', () => {
cy.contains('button', 'Continue').click();
cy.url().should('contain', '/your-details');

cy.contains('There is also an attorney called Jessie Jones.');
cy.contains('There is also an attorney called Jessie Jones. By saving this section, you are confirming that these are two different people with the same name.');

cy.get('#f-can-sign').check();
cy.contains('button', 'Continue').click();
cy.url().should('contain', '/your-address');
});

it('permanently warns when date of birth is under 18', () => {
cy.get('#f-first-names').type('John');
cy.get('#f-last-name').type('Doe');
cy.get('#f-date-of-birth').type('1');
cy.get('#f-date-of-birth-month').type('2');
cy.get('#f-date-of-birth-year').type(new Date().getFullYear());
cy.get('#f-can-sign').check();
cy.contains('button', 'Continue').click();
cy.url().should('contain', '/your-details');

cy.contains('You are under 18. By continuing, you understand that you must be at least 18 years old on the date you sign the LPA, or it will be rejected.');

cy.contains('button', 'Continue').click();
cy.url().should('contain', '/your-address');

cy.visitLpa("/task-list")
cy.contains('a', 'Provide your details').click()
cy.url().should('contain', '/your-details');

cy.contains('You are under 18. By continuing, you understand that you must be at least 18 years old on the date you sign the LPA, or it will be rejected.');
});

it('warns when date of birth is over 100', () => {
cy.get('#f-first-names').type('John');
cy.get('#f-last-name').type('Doe');
cy.get('#f-date-of-birth').type('1');
cy.get('#f-date-of-birth-month').type('2');
cy.get('#f-date-of-birth-year').type('1900');
cy.get('#f-can-sign').check();
cy.contains('button', 'Continue').click();
cy.url().should('contain', '/your-details');

cy.contains('By continuing, you confirm that this person is more than 100 years old. If not, please change their date of birth.');

cy.contains('button', 'Continue').click();
cy.url().should('contain', '/your-address');
});
});
Loading

0 comments on commit eb214b5

Please sign in to comment.