mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[dashboard] After update filter, trigger new queries when charts are visible (#7233)
* trigger query when chart is visible * add integration test
This commit is contained in:
@@ -39,7 +39,7 @@ describe('Dashboard', () => {
|
||||
actions: {
|
||||
addSliceToDashboard() {},
|
||||
removeSliceFromDashboard() {},
|
||||
postChartFormData() {},
|
||||
triggerQuery() {},
|
||||
logEvent() {},
|
||||
},
|
||||
initMessages: [],
|
||||
@@ -82,15 +82,15 @@ describe('Dashboard', () => {
|
||||
},
|
||||
};
|
||||
|
||||
it('should call postChartFormData for all non-exempt slices', () => {
|
||||
it('should call triggerQuery for all non-exempt slices', () => {
|
||||
const wrapper = setup({ charts: overrideCharts, slices: overrideSlices });
|
||||
const spy = sinon.spy(props.actions, 'postChartFormData');
|
||||
const spy = sinon.spy(props.actions, 'triggerQuery');
|
||||
wrapper.instance().refreshExcept('1001');
|
||||
spy.restore();
|
||||
expect(spy.callCount).toBe(Object.keys(overrideCharts).length - 1);
|
||||
});
|
||||
|
||||
it('should not call postChartFormData for filter_immune_slices', () => {
|
||||
it('should not call triggerQuery for filter_immune_slices', () => {
|
||||
const wrapper = setup({
|
||||
charts: overrideCharts,
|
||||
dashboardInfo: {
|
||||
@@ -103,7 +103,7 @@ describe('Dashboard', () => {
|
||||
},
|
||||
},
|
||||
});
|
||||
const spy = sinon.spy(props.actions, 'postChartFormData');
|
||||
const spy = sinon.spy(props.actions, 'triggerQuery');
|
||||
wrapper.instance().refreshExcept();
|
||||
spy.restore();
|
||||
expect(spy.callCount).toBe(0);
|
||||
|
||||
Reference in New Issue
Block a user