enzyme -> RTL: convert the ActivityStream screen suites - #442
Merged
Conversation
Migrate the ActivityStream screen's test suite off enzyme/mountWithContexts onto renderWithContexts (React Testing Library): ActivityStream page, ActivityStreamListItem, ActivityStreamDescription and the detail modal button. 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
This PR continues the incremental Enzyme → React Testing Library migration by converting the ActivityStream screen’s test suites to use renderWithContexts, RTL screen queries, and userEvent-driven interactions while preserving existing behavioral assertions.
Changes:
- Migrates ActivityStream-related tests from
mountWithContexts(Enzyme) torenderWithContexts(RTL). - Updates assertions to use accessible queries (
getByRole,findByRole) and real user interactions (user.click). - Adjusts the detail modal “changes” assertion to validate the CodeEditor presence and JSON/YAML mode selection under jsdom constraints.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| awx/ui/src/screens/ActivityStream/ActivityStream.test.js | Converts screen load assertion to RTL and waits for the heading to appear. |
| awx/ui/src/screens/ActivityStream/ActivityStreamDescription.test.js | Converts link/plain-text behavior tests to RTL role/text-based assertions. |
| awx/ui/src/screens/ActivityStream/ActivityStreamDetailButton.test.js | Converts modal open/detail assertions to RTL + userEvent, updates CodeEditor-related assertions for jsdom. |
| awx/ui/src/screens/ActivityStream/ActivityStreamListItem.test.js | Converts basic render test to RTL and asserts row presence. |
| renderWithContexts( | ||
| <table> | ||
| <tbody> | ||
| <ActivityStreamListItem |
blaipr
force-pushed
the
feature/rtl-batch-activity-stream
branch
from
June 17, 2026 07:58
36542fb to
5e5cd4d
Compare
Contributor
Author
|
Thanks for the review. The dead onSelect prop has been removed from the ActivityStreamListItem test. |
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 ActivityStream 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:ActivityStream— page heading renders after loadActivityStreamListItem— row renderingActivityStreamDescription— plain text, linked-resource (href), and fallback (no link) casesActivityStreamDetailButton— detail modal open/close and detail fields (assertDetail)Interactions now go through accessible roles and real user events. Behaviour and assertions are preserved.
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
npm testfor the ActivityStream directory: 4 suites, 7 tests, all passing. ESLint clean. No production code changed — test-only.One detail-modal assertion was adapted: the original read the CodeEditor's
valueprop for the JSON changes payload. RTL can't read props and Ace renders no DOM text under jsdom, so the test instead asserts the changes-preview element is present and thatVariablesDetailengaged JSON mode (only selected when the changes value parses as JSON) — preserving the original intent.