docs(web): smoke test checklist UDT-002 — login, refresh, logout, reuse detection
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user