Skip to content

Commit

Permalink
integration test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rgforsyth committed Oct 2, 2024
1 parent a69431c commit 31aafeb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
13 changes: 5 additions & 8 deletions integration_tests/integration/amend-referral.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ context('Amend a referral', () => {
.last()
.children()
.should('contain', 'Desired outcomes')
.find('#change-link-2')
.find('#change-link-3')
.click()

cy.location('pathname').should(
Expand All @@ -415,7 +415,7 @@ context('Amend a referral', () => {
.children()
.should('contain', 'Complexity level')
.should('contain', 'Desired outcomes')
.find('#change-link-2')
.find('#change-link-3')
.click()

cy.location('pathname').should(
Expand Down Expand Up @@ -757,10 +757,7 @@ context('Amend a referral', () => {

it('takes the pp to the form when clicking the change link in the details page', () => {
cy.login(`/probation-practitioner/referrals/${sentReferral.id}/details`)
cy.contains(
'.govuk-summary-list__key',
'Reason for the referral and further information for the service provider'
)
cy.contains('.govuk-summary-list__key', 'Reason for referral and referral details')
.next()
.next()
.contains('Change')
Expand Down Expand Up @@ -802,10 +799,10 @@ context('Amend a referral', () => {
cy.get('textarea[name="amend-reason-for-referral"]').clear()
cy.contains('Save and continue').click()

cy.contains('There is a problem').next().contains('Enter reason for the referral and any further information')
cy.contains('There is a problem').next().contains('Enter reason for the referral and referral details')
cy.get('textarea[name="amend-reason-for-referral"]')
.prev()
.contains('Enter reason for the referral and any further information')
.contains('Enter reason for the referral and referral details')
})
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ describe('Probation practitioner referrals dashboard', () => {
.children()
.should('contain', 'Complexity level')
.should('contain', 'Desired outcomes')
.find('#change-link-2')
.find('#change-link-3')
.click()

cy.location('pathname').should(
Expand Down
8 changes: 5 additions & 3 deletions integration_tests/integration/referral.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@ describe('Referral form', () => {
cy.contains('Save and continue').click()
cy.visit(`/referrals/${draftReferral.id}/reason-for-referral`)
cy.get('h1').contains('Provide the reason for this referral and further information for the service provider')
cy.get('textarea').type('Some information about Alex')
cy.get('#reason-for-referral').type('Some information about Alex')
cy.get('#reason-for-referral-further-information').type('Some information about Alex')

// stub completed draft referral to mark section as completed
cy.stubGetDraftReferral(draftReferral.id, completedDraftReferral)
Expand Down Expand Up @@ -560,7 +561,7 @@ describe('Referral form', () => {
.next()
.contains('Change')
.should('have.attr', 'href', `/referrals/${draftReferral.id}/completion-deadline`)
cy.contains('Reason for referral and further information for the service provider')
cy.contains('Reason for referral and referral details')
.next()
.should('contain', 'Some information about Alex')
.next()
Expand Down Expand Up @@ -1171,7 +1172,8 @@ describe('Referral form', () => {

cy.location('pathname').should('equal', `/referrals/${draftReferral.id}/reason-for-referral`)
cy.get('h1').contains('Provide the reason for this referral and further information for the service provider')
cy.get('textarea').type('Some information about Alex')
cy.get('#reason-for-referral').type('Some information about Alex')
cy.get('#reason-for-referral-further-information').type('Some information about Alex')

// stub completed draft referral to mark section as completed
cy.stubGetDraftReferral(draftReferral.id, completedDraftReferral)
Expand Down
13 changes: 8 additions & 5 deletions integration_tests/integration/referralUnAllocatedCom.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ describe('Referral form', () => {
cy.contains('Save and continue').click()
cy.visit(`/referrals/${draftReferral.id}/reason-for-referral`)
cy.get('h1').contains('Provide the reason for this referral and further information for the service provider')
cy.get('textarea').type('Some information about Alex')
cy.get('#reason-for-referral').type('Some information about Alex')
cy.get('#reason-for-referral-further-information').type('Some information about Alex')

// stub completed draft referral to mark section as completed
cy.stubGetDraftReferral(draftReferral.id, completedDraftReferral)
Expand Down Expand Up @@ -713,7 +714,7 @@ describe('Referral form', () => {
.next()
.contains('Change')
.should('have.attr', 'href', `/referrals/${draftReferral.id}/completion-deadline`)
cy.contains('Reason for referral and further information for the service provider')
cy.contains('Reason for referral and referral details')
.next()
.should('contain', 'Some information about Alex')
.next()
Expand Down Expand Up @@ -1162,7 +1163,8 @@ describe('Referral form', () => {
cy.contains('Save and continue').click()
cy.visit(`/referrals/${draftReferral.id}/reason-for-referral`)
cy.get('h1').contains('Provide the reason for this referral and further information for the service provider')
cy.get('textarea').type('Some reason')
cy.get('#reason-for-referral').type('Some reason')
cy.get('#reason-for-referral-further-information').type('Some reason')

// stub completed draft referral to mark section as completed
cy.stubGetDraftReferral(draftReferral.id, completedDraftReferral)
Expand Down Expand Up @@ -1323,7 +1325,7 @@ describe('Referral form', () => {
.next()
.contains('Change')
.should('have.attr', 'href', `/referrals/${draftReferral.id}/completion-deadline`)
cy.contains('Reason for referral and further information for the service provider')
cy.contains('Reason for referral and referral details')
.next()
.should('contain', 'Some information about Alex')
.next()
Expand Down Expand Up @@ -1917,7 +1919,8 @@ describe('Referral form', () => {

cy.location('pathname').should('equal', `/referrals/${draftReferral.id}/reason-for-referral`)
cy.get('h1').contains('Provide the reason for this referral and further information for the service provider')
cy.get('textarea').type('Some information about Alex')
cy.get('#reason-for-referral').type('Some information about Alex')
cy.get('#reason-for-referral-further-information').type('Some information about Alex')

// stub completed draft referral to mark section as completed
cy.stubGetDraftReferral(draftReferral.id, completedDraftReferral)
Expand Down
5 changes: 3 additions & 2 deletions integration_tests/integration/updatePPDetails.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,8 @@ describe('Referral form', () => {
cy.contains('Save and continue').click()
cy.visit(`/referrals/${draftReferral.id}/reason-for-referral`)
cy.get('h1').contains('Provide the reason for this referral and further information for the service provider')
cy.get('textarea').type('Some information about Alex')
cy.get('#reason-for-referral').type('Some information about Alex')
cy.get('#reason-for-referral-further-information').type('Some information about Alex')

// stub completed draft referral to mark section as completed
cy.stubGetDraftReferral(draftReferral.id, completedDraftReferral)
Expand Down Expand Up @@ -834,7 +835,7 @@ describe('Referral form', () => {
.next()
.contains('Change')
.should('have.attr', 'href', `/referrals/${draftReferral.id}/completion-deadline`)
cy.contains('Reason for referral and further information for the service provider')
cy.contains('Reason for referral and referral details')
.next()
.should('contain', 'Some reason')
.next()
Expand Down

0 comments on commit 31aafeb

Please sign in to comment.