[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:
Grace Guo
2019-05-07 23:41:18 -07:00
committed by GitHub
parent 959c35d506
commit 6b8bda6096
21 changed files with 591 additions and 57 deletions

View File

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