add today page cypress spec

This commit is contained in:
Yisroel Baum 2026-04-26 20:50:52 +03:00
parent 8eb0f2366b
commit 0b4d7238af
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

32
cypress/e2e/today.cy.js Normal file
View file

@ -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')
})
})