Skip to content

test: add unit tests for Zustand store actions#128

Merged
RUKAYAT-CODER merged 1 commit intorinafcode:mainfrom
shadrach68:main
Apr 26, 2026
Merged

test: add unit tests for Zustand store actions#128
RUKAYAT-CODER merged 1 commit intorinafcode:mainfrom
shadrach68:main

Conversation

@shadrach68
Copy link
Copy Markdown
Contributor

@shadrach68 shadrach68 commented Apr 26, 2026

Closes #128

Description of Changes:

  • Created a new test file tests/store.test.ts to test the global Zustand store (useAppStore).
  • Added comprehensive unit tests for all store actions to verify state changes and protect business logic from regressions.
  • Tested the following store actions:
    • setAuthLoading & setAuthError (UI state management)
    • setUser & setTokens (Authentication state synchronization)
    • logout (Ensuring session data is cleared while app preferences persist)
    • setTheme (App preferences)
  • Implemented proper TypeScript typing using the AuthUser interface for the test mocks to ensure strict type safety and satisfy ESLint rules.

@RUKAYAT-CODER RUKAYAT-CODER merged commit 9f8063d into rinafcode:main Apr 26, 2026
1 check passed
@shadrach68
Copy link
Copy Markdown
Contributor Author

Please my point wasn't given to me because I said close #38 instead of close #128. Please, I don't know what to do. Help me out.

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.

2 participants