-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MLPAB-2228 Split your details page and prevent editing after identity…
… check (#1378)
- Loading branch information
Showing
46 changed files
with
1,405 additions
and
1,527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
describe('Can you sign your LPA', () => { | ||
describe('first time', () => { | ||
beforeEach(() => { | ||
cy.visit('/fixtures?redirect=/can-you-sign-your-lpa'); | ||
}); | ||
|
||
it('can be submitted', () => { | ||
cy.checkA11yApp(); | ||
cy.contains('a', 'Return to task list').should('not.exist'); | ||
|
||
cy.get('#f-can-sign').check({ force: true }); | ||
|
||
cy.contains('button', 'Save and continue').click(); | ||
cy.url().should('contain', '/your-preferred-language'); | ||
}); | ||
|
||
it('errors when empty', () => { | ||
cy.contains('button', 'Save and continue').click(); | ||
|
||
cy.get('.govuk-error-summary').within(() => { | ||
cy.contains('Select yes if you can sign yourself online'); | ||
}); | ||
|
||
cy.contains('fieldset .govuk-error-message', 'Select yes if you can sign yourself online'); | ||
}); | ||
}); | ||
|
||
describe('after completing', () => { | ||
beforeEach(() => { | ||
cy.visit('/fixtures?redirect=/can-you-sign-your-lpa&progress=chooseYourAttorneys'); | ||
}); | ||
|
||
it('shows task list button', () => { | ||
cy.contains('a', 'Return to task list'); | ||
}); | ||
}); | ||
}); |
46 changes: 23 additions & 23 deletions
46
cypress/e2e/donor/confirm-your-certificate-provider-is-not-related.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
describe('Confirm your certificate provider is not related', () => { | ||
beforeEach(() => { | ||
cy.visit('/fixtures?redirect=/your-details&progress=addCorrespondent'); | ||
cy.get('#f-last-name').clear().type('Cooper'); | ||
cy.contains('button', 'Continue').click(); | ||
cy.visitLpa('/task-list'); | ||
cy.contains('li', "Check and send to your certificate provider") | ||
.should('contain', 'Not started') | ||
.find('a') | ||
.click(); | ||
}); | ||
beforeEach(() => { | ||
cy.visit('/fixtures?redirect=/your-name&progress=addCorrespondent'); | ||
cy.get('#f-last-name').clear().type('Cooper'); | ||
cy.contains('button', 'Save and continue').click(); | ||
cy.visitLpa('/task-list'); | ||
cy.contains('li', "Check and send to your certificate provider") | ||
.should('contain', 'Not started') | ||
.find('a') | ||
.click(); | ||
}); | ||
|
||
it('continues when selected', () => { | ||
cy.checkA11yApp(); | ||
|
||
it('continues when selected', () => { | ||
cy.checkA11yApp(); | ||
cy.get('#f-yes-no').click({ force: true }); | ||
cy.contains('button', 'Continue').click(); | ||
cy.url().should('contain', '/check-your-lpa'); | ||
}); | ||
|
||
cy.get('#f-yes-no').click({ force: true }); | ||
cy.contains('button', 'Continue').click(); | ||
cy.url().should('contain', '/check-your-lpa'); | ||
}); | ||
it('errors when not selected', () => { | ||
cy.contains('button', 'Continue').click(); | ||
|
||
it('errors when not selected', () => { | ||
cy.contains('button', 'Continue').click(); | ||
cy.get('.govuk-error-summary').within(() => { | ||
cy.contains('Select the box to confirm your certificate provider is not related to you or your attorneys, or choose another certificate provider'); | ||
}); | ||
|
||
cy.get('.govuk-error-summary').within(() => { | ||
cy.contains('Select the box to confirm your certificate provider is not related to you or your attorneys, or choose another certificate provider'); | ||
cy.contains('.govuk-error-message', 'Select the box to confirm your certificate provider is not related to you or your attorneys, or choose another certificate provider'); | ||
}); | ||
|
||
cy.contains('.govuk-error-message', 'Select the box to confirm your certificate provider is not related to you or your attorneys, or choose another certificate provider'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
describe('Your date of birth', () => { | ||
describe('first time', () => { | ||
beforeEach(() => { | ||
cy.visit('/fixtures?redirect=/your-date-of-birth'); | ||
}); | ||
|
||
it('can be submitted', () => { | ||
cy.checkA11yApp(); | ||
cy.contains('a', 'Return to task list').should('not.exist'); | ||
|
||
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('1990'); | ||
|
||
cy.contains('button', 'Save and continue').click(); | ||
cy.url().should('contain', '/your-address'); | ||
}); | ||
|
||
it('errors when empty', () => { | ||
cy.contains('button', 'Save and continue').click(); | ||
|
||
cy.get('.govuk-error-summary').within(() => { | ||
cy.contains('Enter date of birth'); | ||
}); | ||
|
||
cy.contains('#date-of-birth-hint + .govuk-error-message', 'Enter date of birth'); | ||
}); | ||
|
||
it('errors when invalid dates of birth', () => { | ||
cy.get('#f-date-of-birth').type('1'); | ||
cy.contains('button', 'Save and continue').click(); | ||
cy.contains('#date-of-birth-hint + .govuk-error-message', 'Date of birth must include a month and year'); | ||
|
||
cy.get('#f-date-of-birth-month').type('2'); | ||
cy.get('#f-date-of-birth-year').type('2222'); | ||
cy.contains('button', 'Save and continue').click(); | ||
cy.contains('#date-of-birth-hint + .govuk-error-message', 'Date of birth must be in the past'); | ||
|
||
cy.get('#f-date-of-birth-month').type('2'); | ||
cy.get('#f-date-of-birth-year').clear().type('1990'); | ||
cy.contains('button', 'Save and continue').click(); | ||
cy.contains('#date-of-birth-hint + .govuk-error-message', 'Date of birth must be a real date'); | ||
}); | ||
|
||
it('permanently warns when date of birth is under 18', () => { | ||
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() - 1); | ||
cy.contains('button', 'Save and continue').click(); | ||
cy.url().should('contain', '/your-date-of-birth'); | ||
|
||
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', 'Save and continue').click(); | ||
cy.url().should('contain', '/your-address'); | ||
|
||
cy.visitLpa("/your-date-of-birth") | ||
cy.url().should('contain', '/your-date-of-birth'); | ||
|
||
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-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', '/your-date-of-birth'); | ||
|
||
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', '/your-address'); | ||
}); | ||
}); | ||
|
||
describe('after completing', () => { | ||
beforeEach(() => { | ||
cy.visit('/fixtures?redirect=/your-date-of-birth&progress=chooseYourAttorneys'); | ||
}); | ||
|
||
it('shows task list button', () => { | ||
cy.contains('a', 'Return to task list'); | ||
cy.contains('button', 'Save and continue').click(); | ||
cy.url().should('contain', '/your-details'); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.