This is an automated email from the ASF dual-hosted git repository.

jli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 664c465d805 fix(test): use correct @apache-superset/core/theme import 
in Menu test (#38457)
664c465d805 is described below

commit 664c465d805ea1c9e5e585c258c2fc1223febce1
Author: Joe Li <[email protected]>
AuthorDate: Thu Mar 5 15:50:35 2026 -0800

    fix(test): use correct @apache-superset/core/theme import in Menu test 
(#38457)
    
    Co-authored-by: Claude Opus 4.6 <[email protected]>
---
 superset-frontend/src/features/home/Menu.test.tsx | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/superset-frontend/src/features/home/Menu.test.tsx 
b/superset-frontend/src/features/home/Menu.test.tsx
index 2c07963c7b7..f2583cb20b3 100644
--- a/superset-frontend/src/features/home/Menu.test.tsx
+++ b/superset-frontend/src/features/home/Menu.test.tsx
@@ -21,12 +21,12 @@ import fetchMock from 'fetch-mock';
 import { render, screen, userEvent } from 'spec/helpers/testing-library';
 import setupCodeOverrides from 'src/setup/setupCodeOverrides';
 import { getExtensionsRegistry } from '@superset-ui/core';
-import * as CoreUI from '@apache-superset/core/ui';
+import * as CoreTheme from '@apache-superset/core/theme';
 import { Menu } from './Menu';
 import * as getBootstrapData from 'src/utils/getBootstrapData';
 
-jest.mock('@apache-superset/core/ui', () => ({
-  ...jest.requireActual('@apache-superset/core/ui'),
+jest.mock('@apache-superset/core/theme', () => ({
+  ...jest.requireActual('@apache-superset/core/theme'),
   useTheme: jest.fn(),
 }));
 
@@ -250,7 +250,7 @@ const staticAssetsPrefixMock = jest.spyOn(
   'staticAssetsPrefix',
 );
 const applicationRootMock = jest.spyOn(getBootstrapData, 'applicationRoot');
-const useThemeMock = CoreUI.useTheme as jest.Mock;
+const useThemeMock = CoreTheme.useTheme as jest.Mock;
 
 fetchMock.get(
   
'glob:*api/v1/database/?q=(filters:!((col:allow_file_upload,opr:upload_is_enabled,value:!t)))',
@@ -264,7 +264,7 @@ beforeEach(() => {
   staticAssetsPrefixMock.mockReturnValue('');
   applicationRootMock.mockReturnValue('');
   // By default useTheme returns the real default theme (brandLogoUrl is falsy)
-  useThemeMock.mockReturnValue(CoreUI.supersetTheme);
+  useThemeMock.mockReturnValue(CoreTheme.supersetTheme);
 });
 
 test('should render', async () => {
@@ -690,7 +690,7 @@ test('should not render the brand text if not available', 
async () => {
 test('brand logo href should not be prefixed with app root when brandLogoHref 
is an absolute URL', async () => {
   applicationRootMock.mockReturnValue('/superset');
   useThemeMock.mockReturnValue({
-    ...CoreUI.supersetTheme,
+    ...CoreTheme.supersetTheme,
     brandLogoUrl: '/static/assets/images/custom-logo.png',
     brandLogoHref: 'https://external.example.com',
   });
@@ -712,7 +712,7 @@ test('brand logo href should not be prefixed with app root 
when brandLogoHref is
 test('brand logo href should not be prefixed with app root when brandLogoHref 
is protocol-relative', async () => {
   applicationRootMock.mockReturnValue('/superset');
   useThemeMock.mockReturnValue({
-    ...CoreUI.supersetTheme,
+    ...CoreTheme.supersetTheme,
     brandLogoUrl: '/static/assets/images/custom-logo.png',
     brandLogoHref: '//external.example.com',
   });

Reply via email to