Skip to content

Commit

Permalink
PP-11788 Products: PaymentCreationException
Browse files Browse the repository at this point in the history
Amend tests to cater for changes in error messages following review.
  • Loading branch information
JFSGDS committed Nov 23, 2023
1 parent 86a5d5f commit 2bb4513
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ describe('Payment link visited with invalid amount in query params', () => {
it('should show an error page when the payment link is visited', () => {
cy.visit(`/redirect/${serviceNamePath}/${productNamePath}?amount=not-valid`, { failOnStatusCode: false })
cy.get('h1').should('have.text', 'An error occurred:')
cy.get('[data-cy=error-message]').should('contain.text', 'Amount must be in pounds and pence using digits and a decimal point, like 123.45 or 156.00 and £100,000 or less.')
cy.get('[data-cy=error-message]').should('contain.text', 'There is a problem with the link you have been sent to use to pay. Please contact the service you\'re trying to make a payment to.')
cy.get('[data-cy=error-message]').should('contain.text', 'Enter an amount in pence. For example “2000”.')
cy.get('[data-cy=error-message]').should('contain.text', 'There is a problem with the link you have been sent to use to pay. Please contact the service you are trying to make a payment to.')
})
})

Expand All @@ -90,7 +90,7 @@ describe('Payment link visited with invalid reference in query params', () => {
it('should show an error page when the payment link is visited', () => {
cy.visit(`/redirect/${serviceNamePath}/${productNamePath}?reference=<>`, { failOnStatusCode: false })
cy.get('h1').should('have.text', 'An error occurred:')
cy.get('[data-cy=error-message]').should('contain.text', 'Reference must be 255 characters or fewer. You can’t use any of the following characters')
cy.get('[data-cy=error-message]').should('contain.text', 'There is a problem with the link you have been sent to use to pay. Please contact the service you\'re trying to make a payment to.')
cy.get('[data-cy=error-message]').should('contain.text', 'Reference must be 255 characters or fewer. You cannot use any of the following characters')
cy.get('[data-cy=error-message]').should('contain.text', 'There is a problem with the link you have been sent to use to pay. Please contact the service you are trying to make a payment to.')
})
})

0 comments on commit 2bb4513

Please sign in to comment.