32 lines
818 B
JavaScript
32 lines
818 B
JavaScript
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')
|
|
})
|
|
})
|