-
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.
Merge pull request #1487 from ministryofjustice/MLPAB-2405-event-tests
MLPAB-2405 Update event tests
- Loading branch information
Showing
29 changed files
with
421 additions
and
393 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 |
---|---|---|
@@ -1,41 +1,41 @@ | ||
describe('LPA type', () => { | ||
it('can be submitted', () => { | ||
cy.visit('/fixtures?redirect=/lpa-type&progress=provideYourDetails'); | ||
it('can be submitted', () => { | ||
cy.visit('/fixtures?redirect=/lpa-type&progress=provideYourDetails'); | ||
|
||
cy.get('#f-lpa-type').check('property-and-affairs'); | ||
cy.get('#f-lpa-type').check('property-and-affairs'); | ||
|
||
cy.checkA11yApp(); | ||
cy.checkA11yApp(); | ||
|
||
cy.contains('button', 'Save and continue').click(); | ||
cy.url().should('contain', '/task-list'); | ||
cy.contains('button', 'Save and continue').click(); | ||
cy.url().should('contain', '/task-list'); | ||
|
||
cy.url().then((url) => { | ||
cy.visit(`http://localhost:9001/?detail-type=uid-requested&detail=${url.split('/')[4]}`); | ||
cy.contains(`"LpaID":"${url.split('/')[4]}"`); | ||
}); | ||
cy.url().then((url) => { | ||
cy.visit(`http://localhost:9001/?detail-type=uid-requested&detail=${url.split('/')[4]}`); | ||
cy.contains(`"lpaID":"${url.split('/')[4]}"`); | ||
}); | ||
|
||
cy.visit('/dashboard') | ||
|
||
cy.visit('/dashboard') | ||
cy.contains('.govuk-body-s', 'Reference number:') | ||
.invoke('text') | ||
.then((text) => { | ||
const uid = text.split(':')[1].trim(); | ||
cy.visit(`http://localhost:9001/?detail-type=application-updated&detail=${uid}`); | ||
|
||
cy.contains('.govuk-body-s', 'Reference number:') | ||
.invoke('text') | ||
.then((text) => { | ||
const uid = text.split(':')[1].trim(); | ||
cy.visit(`http://localhost:9001/?detail-type=application-updated&detail=${uid}`); | ||
cy.contains(`"uid":"${uid}"`); | ||
cy.contains('"type":"property-and-affairs"'); | ||
}); | ||
}); | ||
|
||
cy.contains(`"uid":"${uid}"`); | ||
cy.contains('"type":"property-and-affairs"'); | ||
}); | ||
}); | ||
it('errors when unselected', () => { | ||
cy.visit('/fixtures?redirect=/lpa-type'); | ||
|
||
it('errors when unselected', () => { | ||
cy.visit('/fixtures?redirect=/lpa-type'); | ||
cy.contains('button', 'Save and continue').click(); | ||
|
||
cy.contains('button', 'Save and continue').click(); | ||
cy.get('.govuk-error-summary').within(() => { | ||
cy.contains('Select the type of LPA to make'); | ||
}); | ||
|
||
cy.get('.govuk-error-summary').within(() => { | ||
cy.contains('Select the type of LPA to make'); | ||
cy.contains('.govuk-fieldset .govuk-error-message', 'Select the type of LPA to make'); | ||
}); | ||
|
||
cy.contains('.govuk-fieldset .govuk-error-message', 'Select the type of LPA to make'); | ||
}); | ||
}); |
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,38 +1,35 @@ | ||
describe('Previous application number', () => { | ||
beforeEach(() => { | ||
cy.visit('/fixtures?redirect=/previous-application-number'); | ||
}); | ||
beforeEach(() => { | ||
cy.visit('/fixtures?redirect=/previous-application-number'); | ||
}); | ||
|
||
it('can be submitted', () => { | ||
cy.checkA11yApp(); | ||
it('can be submitted', () => { | ||
cy.checkA11yApp(); | ||
|
||
cy.get('#f-previous-application-number').type('MABC'); | ||
cy.contains('button', 'Save and continue').click(); | ||
cy.get('#f-previous-application-number').type('MABC'); | ||
cy.contains('button', 'Save and continue').click(); | ||
|
||
cy.url().should('contain', '/evidence-successfully-uploaded'); | ||
cy.url().should('contain', '/evidence-successfully-uploaded'); | ||
}); | ||
|
||
cy.visit(`http://localhost:9001/?detail-type=previous-application-linked&detail=`); | ||
cy.contains('"previousApplicationNumber":"MABC"'); | ||
}); | ||
it('errors when unselected', () => { | ||
cy.contains('button', 'Save and continue').click(); | ||
|
||
it('errors when unselected', () => { | ||
cy.contains('button', 'Save and continue').click(); | ||
cy.get('.govuk-error-summary').within(() => { | ||
cy.contains('Enter previous reference number'); | ||
}); | ||
|
||
cy.get('.govuk-error-summary').within(() => { | ||
cy.contains('Enter previous reference number'); | ||
cy.contains('.govuk-error-message', 'Enter previous reference number'); | ||
}); | ||
|
||
cy.contains('.govuk-error-message', 'Enter previous reference number'); | ||
}); | ||
it('errors when not correct format', () => { | ||
cy.get('#f-previous-application-number').type('ABC'); | ||
cy.contains('button', 'Save and continue').click(); | ||
|
||
it('errors when not correct format', () => { | ||
cy.get('#f-previous-application-number').type('ABC'); | ||
cy.contains('button', 'Save and continue').click(); | ||
cy.get('.govuk-error-summary').within(() => { | ||
cy.contains('Previous reference number must begin with the number 7 or the letter M'); | ||
}); | ||
|
||
cy.get('.govuk-error-summary').within(() => { | ||
cy.contains('Previous reference number must begin with the number 7 or the letter M'); | ||
cy.contains('.govuk-error-message', 'Previous reference number must begin with the number 7 or the letter M'); | ||
}); | ||
|
||
cy.contains('.govuk-error-message', 'Previous reference number must begin with the number 7 or the letter M'); | ||
}); | ||
}); |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.