chore(CaretDownIcon): Replace all usages of CaretDownIcon with RhUiCaretDownIcon#12368
chore(CaretDownIcon): Replace all usages of CaretDownIcon with RhUiCaretDownIcon#12368tlabaj wants to merge 2 commits intopatternfly:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (29)
📒 Files selected for processing (39)
✅ Files skipped from review due to trivial changes (34)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughThis PR uniformly replaces various caret-down icon imports/usages (e.g., Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Preview: https://pf-react-pr-12368.surge.sh A11y report: https://pf-react-pr-12368-a11y.surge.sh |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/react-core/src/components/Alert/__tests__/AlertToggleExpandButton.test.tsx (1)
22-22:⚠️ Potential issue | 🟡 Minor
firstChildassertion not migrated as stated in the PR description.The PR description says this assertion was changed to
getByRole('button')with a typedHTMLElementinstead offirstChild, but line 22 still usesscreen.getByTestId('container').firstChild.firstChildis typed asChildNode | null, andtoBeVisible()from@testing-library/jest-domexpects anElement, which can cause a TS error and yields a less robust assertion than targeting the button by role.✏️ Proposed fix
- expect(screen.getByTestId('container').firstChild).toBeVisible(); + expect(screen.getByRole('button')).toBeVisible();The surrounding
<div data-testid="container">wrapper would then no longer be needed.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/react-core/src/components/Alert/__tests__/AlertToggleExpandButton.test.tsx` at line 22, Replace the brittle/incorrect firstChild usage in the test: instead of using screen.getByTestId('container').firstChild with its ChildNode typing, query the button directly via screen.getByRole('button') and assert its visibility with toBeVisible(); update the variable typing to HTMLElement if you store the result, and remove the surrounding <div data-testid="container"> wrapper and any references to getByTestId('container') since the role-based query makes it unnecessary.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In
`@packages/react-core/src/components/Alert/__tests__/AlertToggleExpandButton.test.tsx`:
- Line 22: Replace the brittle/incorrect firstChild usage in the test: instead
of using screen.getByTestId('container').firstChild with its ChildNode typing,
query the button directly via screen.getByRole('button') and assert its
visibility with toBeVisible(); update the variable typing to HTMLElement if you
store the result, and remove the surrounding <div data-testid="container">
wrapper and any references to getByTestId('container') since the role-based
query makes it unnecessary.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3da3402f-8364-4f14-9375-c1f6e77ed278
⛔ Files ignored due to path filters (16)
packages/react-core/src/components/Card/__tests__/__snapshots__/CardHeader.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/DataList/__tests__/__snapshots__/DataListToggle.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/ExpandableSection/__tests__/__snapshots__/ExpandableSection.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/Form/__tests__/__snapshots__/FormFieldGroup.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/FormSelect/__tests__/__snapshots__/FormSelect.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/JumpLinks/__tests__/__snapshots__/JumpLinks.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/MenuToggle/__tests__/__snapshots__/MenuToggle.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/Nav/__tests__/Generated/__snapshots__/NavExpandable.test.tsx.snapis excluded by!**/*.snap,!**/generated/**packages/react-core/src/components/Nav/__tests__/__snapshots__/Nav.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerGroup.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/SearchInput/__tests__/__snapshots__/SearchInput.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/Tabs/__tests__/__snapshots__/OverflowTab.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/components/TreeView/__tests__/__snapshots__/TreeViewListItem.test.tsx.snapis excluded by!**/*.snappackages/react-core/src/deprecated/components/Wizard/__tests__/Generated/__snapshots__/WizardToggle.test.tsx.snapis excluded by!**/*.snap,!**/generated/**packages/react-core/src/deprecated/components/Wizard/__tests__/__snapshots__/Wizard.test.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (39)
packages/react-core/src/components/Accordion/AccordionToggle.tsxpackages/react-core/src/components/Accordion/__tests__/AccordionToggle.test.tsxpackages/react-core/src/components/Alert/AlertToggleExpandButton.tsxpackages/react-core/src/components/Alert/__tests__/AlertToggleExpandButton.test.tsxpackages/react-core/src/components/Breadcrumb/examples/Breadcrumb.mdpackages/react-core/src/components/Card/CardHeader.tsxpackages/react-core/src/components/ClipboardCopy/ClipboardCopyToggle.tsxpackages/react-core/src/components/DataList/DataListToggle.tsxpackages/react-core/src/components/DataList/examples/DataList.mdpackages/react-core/src/components/DualListSelector/DualListSelectorTreeItem.tsxpackages/react-core/src/components/ExpandableSection/ExpandableSection.tsxpackages/react-core/src/components/ExpandableSection/ExpandableSectionToggle.tsxpackages/react-core/src/components/Form/FormFieldGroupToggle.tsxpackages/react-core/src/components/FormSelect/FormSelect.tsxpackages/react-core/src/components/Icon/examples/Icon.mdpackages/react-core/src/components/Icon/examples/IconBasic.tsxpackages/react-core/src/components/JumpLinks/JumpLinks.tsxpackages/react-core/src/components/Menu/examples/Menu.mdpackages/react-core/src/components/MenuToggle/MenuToggle.tsxpackages/react-core/src/components/Modal/examples/Modal.mdpackages/react-core/src/components/Nav/NavExpandable.tsxpackages/react-core/src/components/NotificationDrawer/NotificationDrawerGroup.tsxpackages/react-core/src/components/SearchInput/SearchInput.tsxpackages/react-core/src/components/Tabs/OverflowTab.tsxpackages/react-core/src/components/Tabs/Tabs.tsxpackages/react-core/src/components/TreeView/TreeViewListItem.tsxpackages/react-core/src/components/Wizard/WizardNavItem.tsxpackages/react-core/src/components/Wizard/WizardToggle.tsxpackages/react-core/src/demos/CustomMenus/CustomMenus.mdpackages/react-core/src/demos/DataList/examples/DataListExpandableControlInToolbar.tsxpackages/react-core/src/demos/DataListDemo.mdpackages/react-core/src/deprecated/components/DualListSelector/DualListSelectorTreeItem.tsxpackages/react-core/src/deprecated/components/Modal/examples/Modal.mdpackages/react-core/src/deprecated/components/Wizard/WizardNavItem.tsxpackages/react-core/src/deprecated/components/Wizard/WizardToggle.tsxpackages/react-integration/demo-app-ts/src/components/demos/BreadcrumbDemo/BreadcrumbDemo.tsxpackages/react-table/src/components/Table/CollapseColumn.tsxpackages/react-table/src/components/Table/utils/decorators/treeRow.tsxpackages/react-table/src/demos/Table.md
kmcfaul
left a comment
There was a problem hiding this comment.
Want to confirm - do we want to use the "ui" or "micron" CaretDownIcon from RHDS? Should it be consistently always one set or will there be cases where different sets should be used?
What: towards #12244
Summary
RhUiCaretDownIconfrom@patternfly/react-icons/dist/esm/icons/rh-ui-caret-down-icon, replacingCaretDownIcon(caret-down-icon) andRhMicronsCaretDownIcon(rh-microns-caret-down-icon) across react-core, react-table, integration demos, and doc/example imports.jest.mockpaths where needed; refresh Jest snapshots for DOM changes (single RH UI SVG vs. previous nested PF + RH overlay fromcreateIcon).AlertToggleExpandButton.test.tsx, add@testing-library/jest-domand assertgetByRole('button')fortoBeVisible()(typedHTMLElementvs.firstChild).Summary by CodeRabbit
Style
Tests