Conversation
openmetadata-ui/src/main/resources/ui/src/components/common/FormItemLabel/FormItemLabel.tsx
Outdated
Show resolved
Hide resolved
| MOCK_TAGS_CATEGORY, | ||
| } from './TagsPage.mock'; | ||
|
|
||
| jest.mock('@openmetadata/ui-core-components', () => { |
There was a problem hiding this comment.
💡 Quality: Duplicated @openmetadata/ui-core-components mock across 7+ test files
The identical jest.mock('@openmetadata/ui-core-components', ...) block (with Toggle, Tooltip, TooltipTrigger, Badge, and createMuiTheme mocks) is copy-pasted across at least 7 test files:
- TagsPage.test.tsx
- TagsForm.test.tsx
- FormItemLabel.test.tsx
- TestSuitePipelineTab.test.tsx
- EditTestCaseModal.test.tsx
- EditTestCaseModalV1.test.tsx
- TestCaseForm.test.tsx
- StyleModal.test.tsx
- TestDefinitionForm.test.tsx
This will become a maintenance burden — any API change to these components requires updating every copy. Consider extracting this into a shared mock file (e.g., __mocks__/@openmetadata/ui-core-components.tsx or a shared test utility) and importing it where needed.
Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion
openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsPage.test.tsx
Outdated
Show resolved
Hide resolved
🔍 CI failure analysis for 36ffe57: 4 test failures in TagsForm component caused by missing Grid component reference after form component refactoring; Grid.Item is undefined when tests attempt to render the form layout.OverviewAnalysis of 3 CI logs reveals a single, high-confidence PR-related test failure pattern. The refactored form components have introduced a breaking change affecting the TagsForm component rendering tests. FailuresGrid Component Missing in TagsForm Tests (confidence: high)
Test DetailsFour TagsForm tests fail with identical error:
All fail at line 294 of TagsForm.tsx: Summary
Code Review 👍 Approved with suggestions 5 resolved / 7 findingsMui switch and form label UI migration replaces Ant Design components with Material-UI equivalents, resolving placement type mismatches, copyright dates, and prop compatibility issues. Consider consolidating duplicated 💡 Bug: Unrecognized props spread onto Toggle via switchRest📄 openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx:463 📄 openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/tagFormFields.tsx:178 📄 openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx:465 📄 openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx:474 In the Current callers pass props like Additionally, Consider destructuring all known props explicitly and only spreading validated rest props, similar to how other field types in this file handle their props. Suggested fix💡 Quality: Duplicated
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
|



Describe your changes:
Fixes
I worked on ... because ...
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>Summary by Gitar
FormItemLabelimplementations and replacedMUISwitchwith core components (Toggle,Badge,Tooltip) from@openmetadata/ui-core-components, eliminating dual Ant Design/Material-UI implementationsMUISwitchwrapper, changedFieldTypes.SWITCH_MUItoFieldTypes.UT_SWITCH, updated form rendering to useTogglewithvaluePropName="isSelected"FormItemLabelto dedicated directory using Tailwind CSS styling (tw:classes) and@untitledui/icons, standardized test IDs frommui-*toform-item-*Form/MUIFormItemLabelpaths to newFormItemLabellocation with consistent tooltip placement type (@react-types/overlaysPlacement)This will update automatically on new commits.