From d1116d9c2b49ddc2d36ce819bcaee63f4db9edc8 Mon Sep 17 00:00:00 2001 From: rusackas Date: Mon, 27 Jul 2026 03:37:35 -0700 Subject: [PATCH] fix: address bito review nits (mockAntdWithDesktopBreakpoint reuse, dedupe button css) Co-Authored-By: Claude Opus 4.8 --- .../src/features/home/RightMenu.test.tsx | 12 +++++------- .../src/pages/MobileUnsupported/index.tsx | 18 ++++++++---------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/superset-frontend/src/features/home/RightMenu.test.tsx b/superset-frontend/src/features/home/RightMenu.test.tsx index 1adaabf9d63..12dd9c54b07 100644 --- a/superset-frontend/src/features/home/RightMenu.test.tsx +++ b/superset-frontend/src/features/home/RightMenu.test.tsx @@ -16,6 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +// Imported first: loading this before 'spec/helpers/testing-library' or +// '@superset-ui/core' ensures mockAntdWithDesktopBreakpoint is defined +// before anything transitively requires (and thus mocks) 'antd'. +import { mockAntdWithDesktopBreakpoint } from 'spec/helpers/mobileTestUtils'; import * as reactRedux from 'react-redux'; import fetchMock from 'fetch-mock'; import { @@ -51,13 +55,7 @@ jest.mock('react-redux', () => ({ })); // Mock useBreakpoint to return desktop breakpoints (prevents mobile menu rendering) -jest.mock('antd', () => ({ - ...jest.requireActual('antd'), - Grid: { - ...jest.requireActual('antd').Grid, - useBreakpoint: () => ({ xs: true, sm: true, md: true, lg: true, xl: true }), - }, -})); +jest.mock('antd', () => mockAntdWithDesktopBreakpoint()); jest.mock('src/features/databases/DatabaseModal', () => { const DatabaseModal = () => ; diff --git a/superset-frontend/src/pages/MobileUnsupported/index.tsx b/superset-frontend/src/pages/MobileUnsupported/index.tsx index bbff5bc636c..19e51e3bd67 100644 --- a/superset-frontend/src/pages/MobileUnsupported/index.tsx +++ b/superset-frontend/src/pages/MobileUnsupported/index.tsx @@ -33,6 +33,12 @@ function MobileUnsupported() { const theme = useTheme(); const history = useHistory(); + const actionButtonCss = css` + width: 280px; + height: 48px; + font-size: ${theme.fontSizeSM}px; + `; + const handleViewDashboards = useCallback(() => { history.push('/dashboard/list/'); }, [history]); @@ -108,11 +114,7 @@ function MobileUnsupported() { @@ -127,11 +129,7 @@ function MobileUnsupported() {