Skip to content

[PB-7179]: test/add unit tests for pagination, policy editor, and usage data hooks - #192

Open
jzunigax2 wants to merge 1 commit into
test/react-testing-foundationfrom
test/sub-account-hook-tests
Open

jzunigax2 wants to merge 1 commit into
test/react-testing-foundationfrom
test/sub-account-hook-tests

Conversation

@jzunigax2

Copy link
Copy Markdown
Contributor

What

Unit tests for the three sub-account hooks with real logic in them: useObjectPagination, usePolicyEditor and useUsageData. Also moves usePartnerMonthlyUsage.test.ts to renderHook.

Why

These hooks hold the paging, policy and date-range logic behind the bucket, permissions and usage screens, and none of it was tested. The old usePartnerMonthlyUsage test rendered the hook with its own createRoot code and a settle() loop. Now that Testing Library is installed, renderHook and waitFor do that

- Introduced comprehensive unit tests for the `useObjectPagination`, `usePolicyEditor`, and `useUsageData` hooks to ensure correct functionality and state management.
- Verified pagination behavior, including page navigation and state resets.
- Tested policy editor interactions, including fetching permissions and handling errors.
- Implemented usage data retrieval tests, ensuring correct data formatting and pagination logic.
- Enhanced test coverage for various edge cases and user interactions.
@jzunigax2 jzunigax2 self-assigned this Dec 4, 2026
@jzunigax2
jzunigax2 added this pull request to stack #193 December 4, 2026 15:53
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
object-storage-management-web 12d4c1e Commit Preview URL

Branch Preview URL
Dec 04 2026, 02:33 PM

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.

1 participant