Skip to content

test: add unit tests for useAuthStore (setAuth/logout/persist) - #288

Merged
martinzhames merged 1 commit into
dupdab:mainfrom
Xaxxoo:fix/issue-127-useAuthStore-tests
Sep 1, 2026
Merged

test: add unit tests for useAuthStore (setAuth/logout/persist)#288
martinzhames merged 1 commit into
dupdab:mainfrom
Xaxxoo:fix/issue-127-useAuthStore-tests

Conversation

@Xaxxoo

@Xaxxoo Xaxxoo commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add comprehensive unit tests for the useAuthStore Zustand store in src/lib/store.ts
  • Tests cover setAuth (updates token/merchant in store and persists to localStorage), logout (clears state and removes legacy key), persist middleware (state survives simulated reload), and clearLegacyAccessTokenKey helper

Test plan

  • Run npm test and verify all new tests pass
  • Verify setAuth writes both token and merchant to the Zustand persist key
  • Verify logout clears state and legacy localStorage key
  • Verify persist middleware round-trips state through localStorage

Closes #127

Generated with Claude Code

Closes dupdab#127

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Xaxxoo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@martinzhames
martinzhames merged commit f0f0909 into dupdab:main Sep 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for useAuthStore (setAuth/logout/persist)

2 participants