From 0b4d7238afd49f81e4d420a692e43310a3ad1542 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Sun, 26 Apr 2026 20:50:52 +0300 Subject: [PATCH] add today page cypress spec --- cypress/e2e/today.cy.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 cypress/e2e/today.cy.js diff --git a/cypress/e2e/today.cy.js b/cypress/e2e/today.cy.js new file mode 100644 index 0000000..7332662 --- /dev/null +++ b/cypress/e2e/today.cy.js @@ -0,0 +1,32 @@ +describe('The today page', () => { + beforeEach(() => { + cy.exec('npm run db:seed') + }) + + afterEach(() => { + cy.exec('npm run db:wipe') + }) + + it('redirects to login when not authenticated', () => { + cy.visit('/today') + cy.url().should('include', '/login') + }) + + it('displays a Today heading when authenticated', () => { + cy.loginAsUser() + cy.visit('/today') + cy.get('h1').should('contain', 'Today') + }) + + it('has a list element for scheduled nodes', () => { + cy.loginAsUser() + cy.visit('/today') + cy.get('#scheduled-nodes-list').should('exist') + }) + + it('home page links to the today page', () => { + cy.loginAsUser() + cy.visit('/home') + cy.get('a[href="/today"]').should('be.visible') + }) +})