enzyme -> RTL: convert the ManagementJob screen suites - #438
Merged
Conversation
Migrate the ManagementJob screen's test suite off enzyme/mountWithContexts onto renderWithContexts (React Testing Library): ManagementJobs route panel, ManagementJobList and ManagementJobListItem. Behaviour and assertions are preserved; interactions go through accessible roles and real user events.
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the ManagementJob screen test suites from Enzyme (mountWithContexts) to React Testing Library (renderWithContexts), as part of the incremental enzyme → RTL migration in the UI codebase.
Changes:
- Converted
ManagementJobsroute-level suite to RTL assertions usingscreen. - Converted
ManagementJobListsuite to RTL queries (findByText,queryByRole) and removed enzyme-specific helpers. - Converted
ManagementJobListItemsuite to RTL assertions against accessible output (e.g., launch button by role/name).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| awx/ui/src/screens/ManagementJob/ManagementJobs.test.js | Switches ManagementJobs route test from Enzyme mount to RTL render + screen assertions. |
| awx/ui/src/screens/ManagementJob/ManagementJobList/ManagementJobList.test.js | Converts list suite to RTL and updates async assertions for loaded/error states and add-button visibility. |
| awx/ui/src/screens/ManagementJob/ManagementJobList/ManagementJobListItem.test.js | Converts row item suite to RTL and asserts name/description + launch button via accessible queries. |
Comment on lines
+70
to
+73
| const rows = managementJobs.data.results.map((job) => job.name); | ||
| rows.forEach((name) => { | ||
| expect(screen.getByText(name)).toBeInTheDocument(); | ||
| }); |
# Conflicts: # awx/ui/src/screens/ManagementJob/ManagementJobs.test.js
Contributor
Author
|
Thanks for the review. The test now asserts the exact number of data rows in addition to the job names, so missing or duplicate rows are caught. |
awx/ui/node_modules was committed as a self-referential symlink; .gitignore only excludes the directory contents, not the symlink itself. Untrack it (also removes a cross-PR collision with another open PR that carried the same symlink).
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 ManagementJob screen's test suite from enzyme to React Testing Library, continuing the incremental enzyme → RTL migration (one screen directory per PR).
Files migrated off
mountWithContexts/enzyme ontorenderWithContexts:ManagementJobs— route panel resolves under a real v6<Routes>(router not mocked)ManagementJobList— list rendering, content-error state, add-button visibilityManagementJobListItem— name/description, launch button visibilityInteractions now go through accessible roles and real user events. Behaviour and assertions are preserved.
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
npm testfor the ManagementJob directory: 3 suites, 7 tests, all passing. ESLint clean. No production code changed — test-only.