enzyme -> RTL: convert the PaginatedTable component suites - #458
Merged
cigamit merged 2 commits intoJun 18, 2026
Conversation
Migrate components/PaginatedTable (PaginatedTable, HeaderRow, ActionItem, ToolbarAddButton, ToolbarDeleteButton) off enzyme/mountWithContexts onto renderWithContexts (React Testing Library). Sort/pagination/delete are driven through the real controls and asserted via the resulting history/qs and confirm flow; behaviour and assertions are preserved.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the enzyme → React Testing Library migration by converting the PaginatedTable component test suites to use renderWithContexts and RTL user interactions, preserving assertions around sorting, pagination, and delete confirmation flows.
Changes:
- Migrated PaginatedTable-related component tests from enzyme helpers to RTL (
renderWithContexts,screen,userEvent). - Updated pagination and sorting tests to drive real PatternFly controls and assert via DOM + history/query-string changes.
- Updated delete-confirm tests to assert modal flows and related-delete-details behavior via accessible queries.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| awx/ui/src/components/PaginatedTable/ToolbarDeleteButton.test.js | Converts delete button/confirm flow tests to RTL interactions and modal assertions. |
| awx/ui/src/components/PaginatedTable/ToolbarAddButton.test.js | Converts add button/link tests to RTL using role-based queries and user events. |
| awx/ui/src/components/PaginatedTable/PaginatedTable.test.js | Converts pagination behavior tests to RTL, driving PF pagination controls and asserting history updates. |
| awx/ui/src/components/PaginatedTable/HeaderRow.test.js | Converts header/sort behavior tests to RTL using accessible table queries and click interactions. |
| awx/ui/src/components/PaginatedTable/ActionItem.test.js | Converts ActionItem visibility/tooltip tests to RTL with hover-driven tooltip assertions. |
| const wrapper = shallow( | ||
| test('should render child wrapped with tooltip', async () => { | ||
| const { user } = renderWithContexts( | ||
| <ActionItem columns={1} tooltip="a tooltip" visible> |
| test('should render null if not visible', async () => { | ||
| const wrapper = shallow( | ||
| const { container } = renderWithContexts( | ||
| <ActionItem columns={1} tooltip="foo"> |
Pass the column prop (not columns) so ActionItem is exercised the way ActionsTd injects it.
Contributor
Author
|
Thanks for the review. Pushed a commit: pass the column prop instead of columns so ActionItem is exercised the way ActionsTd injects it. |
cigamit
approved these changes
Jun 18, 2026
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.
SUMMARY
Converts the PaginatedTable component test suite (
components/PaginatedTable) from enzyme to React Testing Library, continuing the enzyme → RTL migration (components, one directory per PR).Files migrated off
mountWithContexts/enzyme ontorenderWithContexts:PaginatedTable,HeaderRow,ActionItem,ToolbarAddButton,ToolbarDeleteButton.Column sort, pagination (next/prev/per-page), and the delete-confirm flow are driven through the real PF controls and asserted via the resulting history/query string and modal flow (rather than inspecting React props). Behaviour and assertions are preserved.
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
npm testforcomponents/PaginatedTable: 6 suites, 22 tests, all passing. ESLint clean (--no-ignore). No production code changed — test-only.