docs(web): smoke test checklist UDT-002 — login, refresh, logout, reuse detection

This commit is contained in:
2026-04-14 13:52:59 -03:00
parent dd4f4dbd5e
commit 7fadb88da0
2 changed files with 113 additions and 5 deletions

View File

@@ -172,8 +172,8 @@ describe('authStore', () => {
})
})
describe('legacy logout compatibility', () => {
it('clears user and accessToken from state', async () => {
describe('legacy logout compatibility (via clearAuth)', () => {
it('clearAuth clears user and accessToken from state', () => {
useAuthStore.getState().setAuth({
user: { id: 1, username: 'admin', nombre: 'Admin', rol: 'admin' },
accessToken: 'some-token',
@@ -181,14 +181,14 @@ describe('authStore', () => {
expiresIn: 3600,
})
await useAuthStore.getState().logout()
useAuthStore.getState().clearAuth()
const state = useAuthStore.getState()
expect(state.user).toBeNull()
expect(state.accessToken).toBeNull()
})
it('removes auth-storage from localStorage on logout', async () => {
it('clearAuth removes auth-storage from localStorage', () => {
useAuthStore.getState().setAuth({
user: { id: 1, username: 'admin', nombre: 'Admin', rol: 'admin' },
accessToken: 'some-token',
@@ -196,7 +196,7 @@ describe('authStore', () => {
expiresIn: 3600,
})
await useAuthStore.getState().logout()
useAuthStore.getState().clearAuth()
const stored = localStorage.getItem('auth-storage')
if (stored !== null) {