fix(ui): unbreak ColumnDetailPanel test suite on 1.12.6#27437
fix(ui): unbreak ColumnDetailPanel test suite on 1.12.6#27437
Conversation
Drop the `@mui/material/styles` mock whose `styled` implementation returned `jest.fn().mockImplementation(...)`. Jest mock functions are non-extensible, so when `@mui/x-tree-view/TreeItem` (pulled transitively via MUIAsyncTreeSelect -> MUIDomainSelect -> formUtils) assigned `TreeItemCheckbox.displayName`, it threw `TypeError: Cannot add property displayName, object is not extensible` and the entire suite failed to load. Verified: 16/16 tests pass after removal. The mock was introduced in #24268 and removed on main in #26396 during the MUI->UntitledUI migration; this brings 1.12.6 in line. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ ApprovedRestores the ColumnDetailPanel test suite compatibility for version 1.12.6. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
❌ UI Checkstyle Failed❌ ESLint + Prettier + Organise Imports (src)One or more source files have linting or formatting issues. ❌ Core Components — ESLint + PrettierOne or more core-component files have linting or formatting issues. Fix locally (fast — only checks files changed in this branch): make ui-checkstyle-changed |
|



Summary
jest.mock('@mui/material/styles', ...)block fromColumnDetailPanel.test.tsxthat made the entire suite fail to load on1.12.6.styledimplementation returnedjest.fn().mockImplementation(...). Jest mock functions are non-extensible, so when@mui/x-tree-view/TreeItem(pulled in transitively viaMUIAsyncTreeSelect -> MUIDomainSelect -> formUtils -> ... -> ColumnDetailPanel) assignedTreeItemCheckbox.displayName, it threwTypeError: Cannot add property displayName, object is not extensible.Background
feat(ui): implement column detail view) and has always been latent.mainit was removed in Migrate EntitySummaryPanel and related components from MUI to untitledUI #26396 during the MUI → UntitledUI migration. That PR wasn't backported to1.12.6, so this branch still carries the broken mock while also pulling in the x-tree-view chain viaformUtils, which is what surfaces the error.Test plan
yarn test --testPathPattern=ColumnDetailPanel.test.tsx→ 16/16 pass locallyeslinton the modified file → cleantsc --noEmit→ no new errorsSonarCloud + Jest Coverageworkflow passes🤖 Generated with Claude Code