Skip to content

done#385

Merged
amina69 merged 8 commits into
amina69:mainfrom
johdanike:main
Jun 4, 2026
Merged

done#385
amina69 merged 8 commits into
amina69:mainfrom
johdanike:main

Conversation

@johdanike

@johdanike johdanike commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

PR Summary

This PR addresses technical debt by removing static mock data references and introduces a comprehensive test suite for the dispute management React Query hooks.

Closes #347: Remove Mock Data and Integrate Real API Data
Closes #203: [Frontend · Dispute system UI] Write dispute hook tests

What changed

  • Mock Data Cleanup (Title: Remove Mock Data and Integrate Real API Data #347)

    • Removed leftover mock data comments and static dummy references in src/components/approval/ApprovalExpiryCountdown.tsx and src/components/approval/ApprovalStatusWidget.tsx.
  • Dispute Hook Tests ([Frontend · Dispute system UI] Write dispute hook tests #203)

    • Added src/hooks/__tests__/useDisputeHooks.test.tsx.
    • Validated useMutateRaiseDispute successfully calls POST /disputes and triggers a success toast.
    • Validated useMutateResolveDispute calls PATCH /disputes/:id and triggers query invalidation on success.
    • Validated useMyDisputes returns the expected scoped data structure.
    • Leveraged existing src/hooks/__tests__/useDisputeDetail.test.tsx to verify isNotFound handling for 404 responses.

Why this matters

Removing static mock data ensures the frontend relies entirely on real backend-driven data for accurate real-world functionality. The new unit tests for the dispute system provide confidence in the API integration, ensuring that raising and resolving disputes correctly manage server state and UI feedback.

Testing

Run the dispute hook test suite:

node_modules/.bin/vitest run src/hooks/__tests__/useDisputeHooks.test.tsx src/hooks/__tests__/useDisputeDetail.test.tsx

Also validate polling hook integration:

node_modules/.bin/vitest run src/lib/hooks/__tests__/usePolling.test.tsx src/lib/hooks/__tests__/useNotificationCount.test.tsx

Notes

  • Uses the existing usePolling hook and apiClient infrastructure for consistency.
  • The notification count hook is designed to be simple and reusable for any badge or nav component that needs unread notification state.

@drips-wave

drips-wave Bot commented Jun 2, 2026

Copy link
Copy Markdown

@johdanike 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

@amina69 amina69 merged commit 297fda3 into amina69:main Jun 4, 2026
1 check passed
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.

Title: Remove Mock Data and Integrate Real API Data [Frontend · Dispute system UI] Write dispute hook tests

2 participants