add test for failed login
This commit is contained in:
parent
b865be9933
commit
4f89dc5e94
1 changed files with 11 additions and 1 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
describe('user login', () => {
|
describe('user login', () => {
|
||||||
it('logs in', () => {
|
beforeEach(() => {
|
||||||
cy.exec('npm run db:seed')
|
cy.exec('npm run db:seed')
|
||||||
|
})
|
||||||
|
it('logs in', () => {
|
||||||
cy.visit('/')
|
cy.visit('/')
|
||||||
cy.get('a').click()
|
cy.get('a').click()
|
||||||
cy.url().should('include', '/login')
|
cy.url().should('include', '/login')
|
||||||
|
|
@ -8,4 +10,12 @@ describe('user login', () => {
|
||||||
cy.get('input[name=password]').type('password{enter}')
|
cy.get('input[name=password]').type('password{enter}')
|
||||||
cy.url().should('include', '/dashboard')
|
cy.url().should('include', '/dashboard')
|
||||||
})
|
})
|
||||||
|
it('doesnt log in', () => {
|
||||||
|
cy.visit('/')
|
||||||
|
cy.get('a').click()
|
||||||
|
cy.url().should('include', '/login')
|
||||||
|
cy.get('input[name=email]').type('test@test.com')
|
||||||
|
cy.get('input[name=password]').type('wrongPassword{enter}')
|
||||||
|
cy.url().should('include', '/login')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue