feat: add deafult buildQuery for V1 chart data requests (#10048)

This commit is contained in:
Ville Brofeldt
2020-06-12 17:49:13 +03:00
committed by GitHub
parent 0724eddb7c
commit ee77707532
3 changed files with 25 additions and 4 deletions

View File

@@ -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');
});
});
});