mirror of
https://github.com/apache/superset.git
synced 2026-07-20 05:36:00 +00:00
fix: simplify DeckGLContainer mock to avoid ESLint require() errors
Replaced complex React.forwardRef mock with simple string mock to resolve: - "Unexpected require()" (global-require) - "Require statement not part of import statement" (@typescript-eslint/no-var-requires) The simplified mock as 'div' is sufficient for integration tests focused on legend functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -49,19 +49,10 @@ jest.mock('@superset-ui/core', () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
// Mock the heavy dependencies that cause test issues
|
||||
jest.mock('./DeckGLContainer', () => {
|
||||
const mockReact = require('react');
|
||||
return {
|
||||
DeckGLContainerStyledWrapper: mockReact.forwardRef((props: any, ref: any) =>
|
||||
mockReact.createElement('div', {
|
||||
'data-testid': 'deck-gl-container',
|
||||
...props,
|
||||
ref,
|
||||
}),
|
||||
),
|
||||
};
|
||||
});
|
||||
// Mock the heavy dependencies that cause test issues
|
||||
jest.mock('./DeckGLContainer', () => ({
|
||||
DeckGLContainerStyledWrapper: 'div',
|
||||
}));
|
||||
|
||||
jest.mock('./utils/colors', () => ({
|
||||
hexToRGB: jest.fn(() => [255, 0, 0, 255]),
|
||||
|
||||
Reference in New Issue
Block a user