mirror of
https://github.com/apache/superset.git
synced 2026-04-14 05:34:38 +00:00
feat: expand new chart data endpoint coverage (#9903)
* feat: implement new chart API for additional components * Fix python tests * Fix tests * Fix lint * fix camel case error in requestParams * lint * fix samples row limit * Add samples row limit to config * remove unnecessary code * lint * Address review comments
This commit is contained in:
@@ -55,7 +55,13 @@ describe('chart actions', () => {
|
||||
.callsFake(() => ({ get: () => fakeMetadata }));
|
||||
buildQueryRegistryStub = sinon
|
||||
.stub(chartlib, 'getChartBuildQueryRegistry')
|
||||
.callsFake(() => ({ get: () => () => ({ some_param: 'fake query!' }) }));
|
||||
.callsFake(() => ({
|
||||
get: () => () => ({
|
||||
some_param: 'fake query!',
|
||||
result_type: 'full',
|
||||
result_format: 'json',
|
||||
}),
|
||||
}));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -76,7 +82,11 @@ describe('chart actions', () => {
|
||||
|
||||
expect(fetchMock.calls(V1_URL)).toHaveLength(1);
|
||||
expect(fetchMock.calls(V1_URL)[0][1].body).toBe(
|
||||
JSON.stringify({ some_param: 'fake query!' }),
|
||||
JSON.stringify({
|
||||
some_param: 'fake query!',
|
||||
result_type: 'full',
|
||||
result_format: 'json',
|
||||
}),
|
||||
);
|
||||
expect(dispatch.args[0][0].type).toBe(actions.CHART_UPDATE_STARTED);
|
||||
});
|
||||
@@ -153,6 +163,7 @@ describe('chart actions', () => {
|
||||
|
||||
return actionThunk(dispatch).then(() => {
|
||||
// chart update, trigger query, update form data, fail
|
||||
expect(fetchMock.calls(MOCK_URL)).toHaveLength(1);
|
||||
expect(dispatch.callCount).toBe(5);
|
||||
expect(dispatch.args[4][0].type).toBe(actions.CHART_UPDATE_TIMEOUT);
|
||||
setupDefaultFetchMock();
|
||||
|
||||
Reference in New Issue
Block a user