show sets on dashboard

This commit is contained in:
Yisroel Baum 2026-08-03 20:31:59 +03:00
parent 2072166bdd
commit 321c1b7bb0
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
4 changed files with 221 additions and 21 deletions

View file

@ -38,6 +38,13 @@ function visitDashboardAndLogout(): void {
}
describe('session authentication', () => {
beforeEach(() => {
cy.intercept('GET', '**/api/sets', {
statusCode: 200,
body: { sets: [] },
})
})
it('restores an authenticated session on a protected route', () => {
cy.intercept('GET', '**/api/me', {
statusCode: 200,
@ -48,7 +55,7 @@ describe('session authentication', () => {
cy.wait('@me')
cy.location('pathname').should('equal', '/dashboard')
cy.get('h1').should('have.text', 'Your next step starts here.')
cy.get('h1').should('have.text', 'Available sets')
})
it('redirects an unauthenticated protected route to login', () => {

View file

@ -63,7 +63,7 @@ describe('sets dashboard', () => {
cy.wait('@sets')
cy.get('[role="status"]').should(
'have.text',
'contain.text',
'No sets are available yet.',
)
})