test guest-only home route

This commit is contained in:
Yisroel Baum 2026-08-03 19:42:58 +03:00
parent d737c07f42
commit 3ba8646091
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -76,6 +76,18 @@ describe('session authentication', () => {
cy.location('pathname').should('equal', '/dashboard') cy.location('pathname').should('equal', '/dashboard')
}) })
it('redirects a restored session away from the home route', () => {
cy.intercept('GET', '**/api/me', {
statusCode: 200,
body: { user: authenticatedUser },
}).as('me')
cy.visit('/')
cy.wait('@me')
cy.location('pathname').should('equal', '/dashboard')
})
it('rejects a malformed authenticated-user response', () => { it('rejects a malformed authenticated-user response', () => {
cy.intercept('GET', '**/api/me', { cy.intercept('GET', '**/api/me', {
statusCode: 200, statusCode: 200,