Skip to content

enzyme -> RTL: convert the DetailList component suites - #472

Merged
cigamit merged 2 commits into
ctrliq:mainfrom
blaipr:feature/rtl-components-detaillist
Jun 18, 2026
Merged

enzyme -> RTL: convert the DetailList component suites#472
cigamit merged 2 commits into
ctrliq:mainfrom
blaipr:feature/rtl-components-detaillist

Conversation

@blaipr

@blaipr blaipr commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
SUMMARY

Converts the DetailList component test suite (components/DetailList) from enzyme to React Testing Library, continuing the enzyme → RTL migration (components, one directory per PR).

Files migrated off enzyme onto renderWithContexts: Detail, DetailList. Label/value pairs are asserted via the rendered dt/dd DOM (and a null-render case). Behaviour and assertions are preserved.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • UI
ADDITIONAL INFORMATION

npm test for components/DetailList: all passing. ESLint clean (--no-ignore). No production code changed — test-only.

Migrate components/DetailList (Detail, DetailList) off enzyme onto
renderWithContexts (React Testing Library). Label/value pairs are asserted
via the rendered dt/dd DOM; behaviour and assertions are preserved.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Not ready to approve

The new RTL tests should be aligned with the repo’s established renderWithContexts/assertDetail helpers and the PR description (currently the suites use raw render() instead).

Pull request overview

This PR continues the UI test migration from Enzyme to React Testing Library for the components/DetailList directory by updating the DetailList and Detail component test suites to assert rendered dt/dd output instead of Enzyme wrapper structure.

Changes:

  • Migrates DetailList.test.js from Enzyme mount() to RTL-style rendering and DOM assertions.
  • Migrates Detail.test.js from Enzyme mount() to RTL-style rendering, adds a null-render assertion for empty values.
File summaries
File Description
awx/ui/src/components/DetailList/DetailList.test.js Rewrites the DetailList suite from Enzyme to RTL assertions over rendered label/value output.
awx/ui/src/components/DetailList/Detail.test.js Rewrites the Detail suite from Enzyme to RTL and adds a test covering the null-render case.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Comment on lines 1 to 3
import React from 'react';
import { mount } from 'enzyme';
import { render, screen } from '@testing-library/react';

Comment on lines 1 to 5
import React from 'react';
import { mount } from 'enzyme';
import { render, screen } from '@testing-library/react';

import Detail from './Detail';

Use the shared renderWithContexts and assertDetail helpers; exercise the empty-string case explicitly with value="".
@blaipr

blaipr commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Pushed a commit: use the shared renderWithContexts and assertDetail helpers, and exercise the empty-string case explicitly by passing an empty value.

@cigamit
cigamit merged commit 7a3ec89 into ctrliq:main Jun 18, 2026
@cigamit cigamit self-assigned this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants