add test for failed login

This commit is contained in:
Yisroel Baum 2025-11-02 23:12:13 +02:00
parent b865be9933
commit 4f89dc5e94
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -1,6 +1,8 @@
describe('user login', () => {
it('logs in', () => {
beforeEach(() => {
cy.exec('npm run db:seed')
})
it('logs in', () => {
cy.visit('/')
cy.get('a').click()
cy.url().should('include', '/login')
@ -8,4 +10,12 @@ describe('user login', () => {
cy.get('input[name=password]').type('password{enter}')
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')
})
})