mirror of
https://github.com/apache/superset.git
synced 2026-04-28 04:25:07 +00:00
feat: add deafult buildQuery for V1 chart data requests (#10048)
This commit is contained in:
@@ -77,7 +77,7 @@ describe('chart actions', () => {
|
||||
|
||||
describe('v1 API', () => {
|
||||
beforeEach(() => {
|
||||
fakeMetadata = { useLegacyApi: false };
|
||||
fakeMetadata = { viz_type: 'my_viz', useLegacyApi: false };
|
||||
});
|
||||
|
||||
it('should query with the built query', async () => {
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
import sinon from 'sinon';
|
||||
|
||||
import URI from 'urijs';
|
||||
import { getExploreUrl, getExploreLongUrl } from 'src/explore/exploreUtils';
|
||||
import {
|
||||
buildV1ChartDataPayload,
|
||||
getExploreUrl,
|
||||
getExploreLongUrl,
|
||||
} from 'src/explore/exploreUtils';
|
||||
import * as hostNamesConfig from 'src/utils/hostNamesConfig';
|
||||
|
||||
describe('exploreUtils', () => {
|
||||
@@ -189,4 +193,13 @@ describe('exploreUtils', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildV1ChartDataPayload', () => {
|
||||
it('generate valid request payload despite no registered buildQuery', () => {
|
||||
const v1RequestPayload = buildV1ChartDataPayload({
|
||||
formData: { ...formData, viz_type: 'my_custom_viz' },
|
||||
});
|
||||
expect(v1RequestPayload).hasOwnProperty('queries');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user