Skip to content

test: add unit tests for the Axios request interceptor in lib/api.ts - #289

Merged
martinzhames merged 1 commit into
dupdab:mainfrom
Xaxxoo:fix/issue-128-request-interceptor-tests
Sep 1, 2026
Merged

test: add unit tests for the Axios request interceptor in lib/api.ts#289
martinzhames merged 1 commit into
dupdab:mainfrom
Xaxxoo:fix/issue-128-request-interceptor-tests

Conversation

@Xaxxoo

@Xaxxoo Xaxxoo commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add unit tests for the Axios request interceptor in src/lib/api.ts
  • Tests verify: Authorization header is set with Bearer token when present, omitted when absent, other headers are preserved, token is read from the Zustand store (not legacy localStorage), and the interceptor uses the current token at call time

Test plan

  • Run npm test and verify all new tests pass
  • Verify the interceptor correctly adds Bearer token from the auth store
  • Verify the interceptor does not add Authorization when no token exists

Closes #128

Generated with Claude Code

Closes dupdab#128

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 c9ce3fb 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 the Axios request interceptor in lib/api.ts

2 participants