test navbar logout

This commit is contained in:
Yisroel Baum 2026-05-24 20:16:20 +03:00
parent 93a8533d76
commit 6018764731
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -35,7 +35,7 @@ describe('admin login page', () => {
})
})
it('logs in with valid credentials and redirects to the home page', () => {
it('logs in and logs out from the home page navbar', () => {
cy.visit('/login')
cy.get('[data-cy="login-email"]').type('admin@rabbigerzi.test')
@ -44,5 +44,10 @@ describe('admin login page', () => {
cy.url().should('eq', Cypress.config().baseUrl + '/')
cy.getCookie('auth_token').should('exist')
cy.get('[data-cy="navbar-logout"]').should('be.visible')
cy.get('[data-cy="navbar-logout"]').click()
cy.getCookie('auth_token').should('not.exist')
cy.get('[data-cy="navbar-logout"]').should('not.exist')
})
})