test(react): add tests and mocks for invitation components#162
Open
rax7389 wants to merge 1 commit intofeat/mm-invitations-hook-containerfrom
Open
test(react): add tests and mocks for invitation components#162rax7389 wants to merge 1 commit intofeat/mm-invitations-hook-containerfrom
rax7389 wants to merge 1 commit intofeat/mm-invitations-hook-containerfrom
Conversation
2d3d1df to
312a1ae
Compare
bcca8bf to
c50d1d9
Compare
312a1ae to
b1ad377
Compare
c50d1d9 to
996913e
Compare
b1ad377 to
1755393
Compare
996913e to
3a5757f
Compare
1755393 to
abd498c
Compare
3a5757f to
4c1f1e1
Compare
dd0358c to
89fff00
Compare
4c1f1e1 to
00772c3
Compare
89fff00 to
f5d3f6e
Compare
00772c3 to
8c4baf4
Compare
f5d3f6e to
2880189
Compare
8c4baf4 to
dba1f1b
Compare
2880189 to
4184f90
Compare
dba1f1b to
1fc27b0
Compare
4184f90 to
d1e9fd7
Compare
1fc27b0 to
33e7ec0
Compare
d1e9fd7 to
5b79311
Compare
33e7ec0 to
b725dd0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Summary: Adds comprehensive test coverage and reusable mock utilities for all invitation management components and hooks introduced in earlier PRs.
Why: This PR adds the full test suite, ensuring every component and hook is covered for rendering, user interactions, edge cases, and accessibility. Reusable mock factories are provided so future tests can spin up test data consistently.
What:
Test Suites
InvitationDetailsModal tests — Rendering, role resolution, read-only mode, button states.
InvitationRevokeModal tests — Revoke vs revoke-and-resend flows, confirmation callbacks.
InvitationTableActionsColumn tests — Context-aware actions, Copy URL visibility, read-only mode.
InvitationCreateModal tests — Zod validation, duplicate email rejection, form submission.
SearchFilter tests — Role filter rendering, empty roles handling.
Mock Utilities
invitation.mocks.ts— Reusable factory functions for consistent test data:core-client.mocks.ts— Addedinvitationsmock methods (list, get, create, delete) tocreateMockMyOrgApiService.References
Part of the member management invitations feature.
Testing
All tests pass. Run with
npm run testfrompackages/react.Checklist