Copilot commented on code in PR #40781:
URL: https://github.com/apache/superset/pull/40781#discussion_r3365878179
##########
superset-frontend/src/features/home/Menu.test.tsx:
##########
@@ -30,11 +30,13 @@ jest.mock('@apache-superset/core/theme', () => ({
useTheme: jest.fn(),
}));
+const mockUseBreakpoint = jest.fn<{ md?: boolean }, []>(() => ({ md: true }));
+
jest.mock('antd', () => ({
...jest.requireActual('antd'),
Grid: {
...jest.requireActual('antd').Grid,
- useBreakpoint: () => ({ md: true }),
+ useBreakpoint: () => mockUseBreakpoint(),
Review Comment:
The antd mock calls `jest.requireActual('antd')` twice inside the factory.
Reusing the same `antd` reference makes the mock clearer and avoids duplicate
module resolution/work during test initialization.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]