test public and protected routes
This commit is contained in:
parent
4e3d8f74b8
commit
edcaf80b98
2 changed files with 12 additions and 1 deletions
|
|
@ -1,8 +1,18 @@
|
|||
describe('guest authentication pages', () => {
|
||||
it('redirects the root route to login', () => {
|
||||
it('shows a public home route to guests', () => {
|
||||
cy.visit('/')
|
||||
|
||||
cy.location('pathname').should('equal', '/')
|
||||
cy.get('h1').should('have.text', 'Make big goals feel possible.')
|
||||
cy.contains('a', 'Log in').should('have.attr', 'href', '/login')
|
||||
cy.contains('a', 'Get started').should('have.attr', 'href', '/signup')
|
||||
})
|
||||
|
||||
it('redirects guests away from the protected dashboard', () => {
|
||||
cy.visit('/dashboard')
|
||||
|
||||
cy.location('pathname').should('equal', '/login')
|
||||
cy.location('search').should('include', 'redirect=/dashboard')
|
||||
})
|
||||
|
||||
it('shows the login form and links to signup', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue