Skip to content

Conversation

suzit-10
Copy link
Contributor

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Describe this PR

This PR addresses the flakiness in the UsersList tests related to updating mapper level and role.
The root cause was inconsistent rendering of the popup triggered by the table rows due to asynchronous TanStack Table rendering.

Changes made:

  • Introduced a flushPromises helper to flush React/TanStack updates after user interactions.
  • Ensured test setup waits for loading animation to disappear and rows/triggers to be fully rendered.
  • Replaced waitFor(getBy...) with findByTestId for stable async querying.
  • Used queryByTestId instead of stale references when validating popup unmount.
  • Added explicit timeout (10s) only for popup-related queries instead of globally extending Jest timeout.

…itFor usage

Added flushPromises helper to ensure TanStack/React state updates complete before assertions

Replaced `waitFor` with `findByTestId` for better async handling
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant