mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
Add visualize advise for long query (#2879)
in SqlLab view, if query takes over 45 seconds, we will show advise to store a summarized data set before user clicks on Visualize button. This advise will not block Visualize button. fixes https://github.com/airbnb/superset/issues/2733
This commit is contained in:
@@ -246,6 +246,26 @@ describe('VisualizeModal', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should build visualize advise for long query', () => {
|
||||
const longQuery = Object.assign({}, queries[0], { endDttm: 1476910666798 });
|
||||
const props = {
|
||||
show: true,
|
||||
query: longQuery,
|
||||
};
|
||||
const longQueryWrapper = shallow(<VisualizeModal {...props} />, {
|
||||
context: { store },
|
||||
}).dive();
|
||||
const alertWrapper = shallow(longQueryWrapper.instance().buildVisualizeAdvise());
|
||||
expect(alertWrapper.hasClass('alert')).to.equal(true);
|
||||
expect(alertWrapper.text()).to.contain(
|
||||
'This query took 101 seconds to run, and the explore view times out at 45 seconds');
|
||||
});
|
||||
|
||||
it('should not build visualize advise', () => {
|
||||
const wrapper = getVisualizeModalWrapper();
|
||||
expect(wrapper.instance().buildVisualizeAdvise()).to.be.a('undefined');
|
||||
});
|
||||
|
||||
describe('visualize', () => {
|
||||
const wrapper = getVisualizeModalWrapper();
|
||||
const mockOptions = { attr: 'mockOptions' };
|
||||
|
||||
Reference in New Issue
Block a user