add today page cypress spec
This commit is contained in:
parent
8eb0f2366b
commit
0b4d7238af
1 changed files with 32 additions and 0 deletions
32
cypress/e2e/today.cy.js
Normal file
32
cypress/e2e/today.cy.js
Normal 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')
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue