Skip to content

Commit 9d16b51

Browse files
rusackasclaude
andcommitted
docs(tests): explain why antd mock is used for Grid.useBreakpoint
Added comment explaining that we mock 'antd' directly rather than '@superset-ui/core/components' because the latter causes circular dependency issues with ActionButton during jest.requireActual evaluation. Since Grid is re-exported from antd, mocking antd works. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 353681a commit 9d16b51

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

superset-frontend/src/features/home/Menu.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ import { Menu } from './Menu';
2525
import * as getBootstrapData from 'src/utils/getBootstrapData';
2626

2727
// Mock useBreakpoint to return desktop breakpoints (prevents mobile menu rendering)
28+
// Note: We mock 'antd' directly rather than '@superset-ui/core/components' because
29+
// mocking the latter causes circular dependency issues with ActionButton during
30+
// jest.requireActual evaluation. Since Grid is re-exported from antd, this works.
2831
jest.mock('antd', () => ({
2932
...jest.requireActual('antd'),
3033
Grid: {

0 commit comments

Comments
 (0)