Skip to content

fix(react): update error handling for member fetch failure message#331

Open
chakrihacker wants to merge 1 commit into
feat/member-managementfrom
fix/resolve-error-message
Open

fix(react): update error handling for member fetch failure message#331
chakrihacker wants to merge 1 commit into
feat/member-managementfrom
fix/resolve-error-message

Conversation

@chakrihacker
Copy link
Copy Markdown
Contributor

@chakrihacker chakrihacker commented Jun 5, 2026

Summary

Corrects a test that was asserting the fallback error message path but inadvertently passing an error with the translation key as its message, masking the real behavior under test.

Why

The test for members.get failure was using new Error() (no message), but the component logic distinguishes between errors that carry a backend message and errors that don't. The test wasn't validating the fallback branch correctly — the assertion happened to pass for the wrong reason.

What

  • Updated the rejected error in organization-member-detail.test.tsx to pass new Error('member.detail.error.fetch_failed') so the test correctly exercises the fallback message path

Packages

  • packages/core
  • packages/react
  • examples

Testing

How can this be verified? Note anything intentionally not covered by tests and why.

  1. Run pnpm test --filter=@auth0/auth0-ui-components-react -- organization-member-detail
  2. Confirm the when members.get fails without a backend message, should show fallback message test passes and covers the intended branch.
  • This change adds unit test coverage
  • Tested for both SPA and RWA flows, all example apps working
  • All existing and new tests complete without errors

Checklist

  • Breaking change
  • Requires docs update
  • Backward compatible

Contributing

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