From ebebe1ed5e8a85d57712a5d6cd38d5f833759179 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Tue, 13 Oct 2020 11:30:18 +0200 Subject: [PATCH] test(e2e): check issue date appears on cert --- cypress/integration/ShowCertification.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cypress/integration/ShowCertification.js b/cypress/integration/ShowCertification.js index af105e545f..ad9673547a 100644 --- a/cypress/integration/ShowCertification.js +++ b/cypress/integration/ShowCertification.js @@ -68,6 +68,14 @@ describe('A certification,', function() { 'https://twitter.com/intent/tweet?text=I just earned the Legacy Front End certification @freeCodeCamp! Check it out here: https://freecodecamp.org/certification/developmentuser/legacy-front-end' ); }); + + it("should be issued with today's date", () => { + const date = new Date(); + const issued = `Issued\xa0${new Intl.DateTimeFormat('en-US', { + month: 'long' + }).format(date)} ${date.getDate()}, ${date.getFullYear()}`; + cy.get('[data-cy=issue-date]').should('have.text', issued); + }); }); describe("while viewing someone else's,", function() {