Skip to content

Commit

Permalink
Update v4 cypress test to check for values regardless of order (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
cshnimble authored Jan 22, 2024
1 parent 83d320b commit d3ad5e7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CypressTests/cypress/e2e/v4/trusts.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,13 @@ describe('Trusts endpoints tests', () => {
})
.then((response) => {
expect(response.status).to.eq(200)
// Response isn't in UKPRN order
expect(response.body[1].name).to.eq(groupName)
expect(response.body[1].ukprn).to.eq(ukprns[0])
expect(response.body[0].name).to.eq('THE BISHOP FRASER TRUST')
expect(response.body[0].ukprn).to.eq(ukprns[1])
expect(response.body).to.have.lengthOf(2)
// Response isn't neccessarily in UKPRN order
const resBody = JSON.stringify(response.body)
expect(resBody).to.have.string(groupName)
expect(resBody).to.have.string(ukprns[0])
expect(resBody).to.have.string('THE BISHOP FRASER TRUST')
expect(resBody).to.have.string(ukprns[1])
})
})
})
Expand Down

0 comments on commit d3ad5e7

Please sign in to comment.