diff --git a/src/app/views/quote-accepted.njk b/src/app/views/quote-accepted.njk index 1c305f84..e7a5cc1b 100644 --- a/src/app/views/quote-accepted.njk +++ b/src/app/views/quote-accepted.njk @@ -3,7 +3,7 @@ {% set hideReturnLink = true %} {% block main_content %} -
You will receive a confirmation email that the quote has been accepted.
+You will receive a confirmation email that the quote has been accepted.
{% include '_includes/payment-instructions.njk' %} {% endblock %} diff --git a/test/end-to-end/cypress/quote-accepted-spec.cy.js b/test/end-to-end/cypress/quote-accepted-spec.cy.js new file mode 100644 index 00000000..656b9572 --- /dev/null +++ b/test/end-to-end/cypress/quote-accepted-spec.cy.js @@ -0,0 +1,20 @@ +const { addMonths, format } = require('date-fns') +const { formats } = require("../../../config"); + +describe("quote acceptance page spec", () => { + it("when accepting a quote", () => { + cy.visit( + "http://localhost:4000/7AGZC7uaAIV-5L34J5lnZXHvFG9J1xnbBQnieAUCn-LRJpr-QA/quote/accepted" + ); + + cy.log('should render all elements correctly') + cy.get('[data-test="confirmation-banner"]').should('contain', 'Quote accepted').and('contain', 'Your reference number is').and('contain', 'WHY589/23') + cy.get('h3').should('have.text', 'What happens next') + cy.get('[data-test="confirmation-text"]').should('have.text', 'You will receive a confirmation email that the quote has been accepted.') + cy.get('[data-test="pay-invoice-text"]').should('have.text', `\n You will need to pay\n the invoice\n by ${format(addMonths(new Date(), 1), formats.dateLong)} (in a month).\n`) + cy.get('[data-test="payment-options-button"]') + .should("contain", "View payment options") + .and('have.attr', 'href', '/7AGZC7uaAIV-5L34J5lnZXHvFG9J1xnbBQnieAUCn-LRJpr-QA/payment') + cy.get('[data-test="order-history-link"]').should('have.text', 'View your order history').and('have.attr', 'href', '/7AGZC7uaAIV-5L34J5lnZXHvFG9J1xnbBQnieAUCn-LRJpr-QA') + }) +}) \ No newline at end of file