enzyme -> RTL: convert the ExecutionEnvironment screen suites - #435
Merged
cigamit merged 2 commits intoJun 18, 2026
Merged
Conversation
Convert the eight enzyme test suites in screens/ExecutionEnvironment to React Testing Library via renderWithContexts (continuing step 3 after ctrliq#433/ctrliq#434): - ListItem, List, Details, Add, Edit, the EE-template sub-list (List + ListItem), and the shared ExecutionEnvironmentForm. - Add/Edit stub the shared form and drive its onSubmit/onCancel/submitError props (Add also exposes the query-param image prefill). - Details/List delete flows use the PF4-modal-in-jsdom confirm-by-label + fireEvent pattern; for Details the DeleteButton related-count fetch is short-circuited with an empty request list so the confirm modal opens. - Form disabled-state assertions target the field inputs and each Lookup's search button by ouiaId; drop two prop-inspection-only delete-detail-count assertions with no DOM-observable behavior. 43 tests pass; screens/ExecutionEnvironment no longer references enzyme.
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the screens/ExecutionEnvironment test suites from Enzyme to React Testing Library as part of the ongoing UI modernization, replacing component-prop inspection with user-visible behavior assertions and the established PF modal interaction patterns.
Changes:
- Converted ExecutionEnvironment list/details/add/edit/form/template-list suites to use
renderWithContexts+ RTL queries/interactions. - Updated delete/copy flows to drive PatternFly modals/buttons via accessible labels (with
fireEventwhere required by PF modal aria-hiding in jsdom). - Stubbed the shared
ExecutionEnvironmentFormin Add/Edit container tests to focus on container behavior (submit/cancel/error + query-param prefill).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| awx/ui/src/screens/ExecutionEnvironment/shared/ExecutionEnvironmentForm.test.js | Converted form suite to RTL; updated field/disabled assertions. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironmentTemplate/ExecutionEnvironmentTemplateListItem.test.js | Converted template sub-list row test to RTL rendering + text assertions. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironmentTemplate/ExecutionEnvironmentTemplateList.test.js | Converted template sub-list test to RTL with async render assertions. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentListItem.test.js | Converted list row suite to RTL; drives copy flow via user interaction. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentList.test.js | Converted list suite to RTL; drives multi-select delete confirm flow. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironmentEdit/ExecutionEnvironmentEdit.test.js | Converted edit container suite to RTL with a stubbed form. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironmentDetails/ExecutionEnvironmentDetails.test.js | Converted details suite to RTL; short-circuits DeleteButton related-count fetch for modal open. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironmentAdd/ExecutionEnvironmentAdd.test.js | Converted add container suite to RTL with a stubbed form + query-param prefill assertion. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironment.test.js | Minor comment update. |
Comment on lines
+68
to
+75
| <ExecutionEnvironmentForm | ||
| onCancel={onCancel} | ||
| onSubmit={onSubmit} | ||
| executionEnvironment={executionEnvironment} | ||
| options={mockOptions} | ||
| me={mockMe} | ||
| {...props} | ||
| /> |
| organization: 9, | ||
| }) | ||
| ); | ||
| expect(history.location.pathname).toBe('/execution_environments/42/details'); |
Comment on lines
73
to
75
| expect(history.location.pathname).toEqual( | ||
| '/execution_environments/42/details' | ||
| ); |
| expect( | ||
| wrapper.find('DeleteButton').prop('deleteDetailsRequests') | ||
| ).toHaveLength(4); | ||
| expect(history.location.pathname).toBe('/execution_environments'); |
Contributor
Author
|
Thanks for the review. The current revision drops the options prop override on ExecutionEnvironmentForm and waits for the pathname change (not just the API call) in the Add, Edit, and Details flows, so the redirect assertions are no longer racy. |
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
Continue the enzyme → React Testing Library migration (step 3 of the React modernization) by converting the
screens/ExecutionEnvironmentsuites. Follows #385/#398,screens/CredentialType(#433), andscreens/NotificationTemplate(#434).renderWithContexts:ExecutionEnvironmentListItem,ExecutionEnvironmentList,ExecutionEnvironmentDetails,ExecutionEnvironmentAdd,ExecutionEnvironmentEdit, the EE-template sub-list (ExecutionEnvironmentTemplateList+ListItem), and the sharedExecutionEnvironmentForm.onSubmit/onCancel/submitErrorprops (Add also asserts the?image=query-param prefill).fireEvent); for Details, theDeleteButtonrelated-count fetch is short-circuited with an empty request list so the confirm modal opens under auto-mock.Lookup's search button byouiaId(organization-open/credential-open); two prop-inspection-only delete-detail-count assertions with no DOM-observable behavior are dropped.No application code changes — test-only.
screens/ExecutionEnvironmentno longer references enzyme.ISSUE TYPE
COMPONENT NAME
ASCENDER VERSION
ADDITIONAL INFORMATION
screens/ExecutionEnvironmentpass (npm test).