mirror of
https://github.com/apache/superset.git
synced 2026-04-22 01:24:43 +00:00
feat(sqllab): SQLEditor Extension (#24205)
This commit is contained in:
@@ -31,6 +31,8 @@ import {
|
||||
} from 'src/SqlLab/fixtures';
|
||||
import SqlEditorLeftBar from 'src/SqlLab/components/SqlEditorLeftBar';
|
||||
import { api } from 'src/hooks/apiResources/queryApi';
|
||||
import { getExtensionsRegistry } from '@superset-ui/core';
|
||||
import setupExtensions from 'src/setup/setupExtensions';
|
||||
|
||||
jest.mock('src/components/AsyncAceEditor', () => ({
|
||||
...jest.requireActual('src/components/AsyncAceEditor'),
|
||||
@@ -246,4 +248,18 @@ describe('SqlEditor', () => {
|
||||
fireEvent.click(await findByText('LIMIT:'));
|
||||
expect(await findByText('10 000')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders an Extension if provided', async () => {
|
||||
const extensionsRegistry = getExtensionsRegistry();
|
||||
|
||||
extensionsRegistry.set('sqleditor.extension.form', () => (
|
||||
<>sqleditor.extension.form extension component</>
|
||||
));
|
||||
|
||||
setupExtensions();
|
||||
const { findByText } = setup(mockedProps, store);
|
||||
expect(
|
||||
await findByText('sqleditor.extension.form extension component'),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user