diff --git a/superset-frontend/src/features/themes/ThemeModal.test.tsx b/superset-frontend/src/features/themes/ThemeModal.test.tsx index 2e5d1a51655..4994863b074 100644 --- a/superset-frontend/src/features/themes/ThemeModal.test.tsx +++ b/superset-frontend/src/features/themes/ThemeModal.test.tsx @@ -17,11 +17,12 @@ * under the License. */ -import { render, screen } from 'spec/helpers/testing-library'; +import { render, screen, waitFor } from 'spec/helpers/testing-library'; import userEvent from '@testing-library/user-event'; import fetchMock from 'fetch-mock'; import ThemeModal from './ThemeModal'; import { ThemeObject } from './types'; +import { validateTheme } from 'src/theme/utils/themeStructureValidation'; const mockThemeContext = { setTemporaryTheme: jest.fn(), @@ -37,6 +38,27 @@ jest.mock('src/dashboard/util/permissionUtils', () => ({ isUserAdmin: jest.fn(() => true), })); +// Mock JsonEditor to avoid direct DOM manipulation in tests +jest.mock('@superset-ui/core/components/AsyncAceEditor', () => ({ + ...jest.requireActual('@superset-ui/core/components/AsyncAceEditor'), + JsonEditor: ({ + onChange, + value, + readOnly, + }: { + onChange: (value: string) => void; + value: string; + readOnly?: boolean; + }) => ( +