yyqdbngt opened a new pull request, #3597:
URL: https://github.com/apache/rocketmq-dashboard/pull/3597

   ### Summary
   
   Adds the first unit tests for the session store that backs the login/logout 
flows.
   
   The store restores the session from the browser on load and keeps 
login/logout in sync with the persisted keys. The tests cover the empty start, 
session restore, non-numeric user id handling, login persistence and logout 
clearing.
   
   ### Changes
   
   - `web/src/stores/authStore.test.ts`
     - `starts unauthenticated when nothing is stored`: null user/id/admin.
     - `restores a persisted session on load`: stored keys hydrate the store.
     - `treats a non-numeric persisted user id as absent`: bad ids degrade to 
null instead of NaN.
     - `login persists and applies the session`: state and the three storage 
keys update together.
     - `logout clears the session and the stored keys`: state and storage reset 
together.
   
   ### Testing
   
   - `vitest run src/stores/authStore.test.ts` passes; `tsc --noEmit` and 
`eslint` clean.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to