mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
fixing tests
This commit is contained in:
parent
f7f0f12439
commit
40234e8e41
2 changed files with 10 additions and 7 deletions
|
@ -134,10 +134,11 @@ describe('renderbot', function exportWrapper() {
|
|||
let buildStub = sinon.stub(renderbot, 'buildChartData', _.constant(football));
|
||||
let renderStub = sinon.stub(renderbot.vislibVis, 'render');
|
||||
|
||||
renderbot.render('flat data', persistedState);
|
||||
expect(renderStub.callCount).to.be(1);
|
||||
expect(buildStub.callCount).to.be(1);
|
||||
expect(renderStub.firstCall.args[0]).to.be(football);
|
||||
renderbot.render('flat data', persistedState).then(() => {
|
||||
expect(renderStub.callCount).to.be(1);
|
||||
expect(buildStub.callCount).to.be(1);
|
||||
expect(renderStub.firstCall.args[0]).to.be(football);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -46,9 +46,11 @@ module.exports = function VislibRenderbotFactory(Private) {
|
|||
VislibRenderbot.prototype.buildChartData = buildChartData;
|
||||
VislibRenderbot.prototype.render = function (esResponse) {
|
||||
this.chartData = this.buildChartData(esResponse);
|
||||
// to allow legend to render first
|
||||
setTimeout(() => {
|
||||
this.vislibVis.render(this.chartData, this.uiState);
|
||||
// to allow legend to render first (wait for angular digest cycle to complete)
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
resolve(this.vislibVis.render(this.chartData, this.uiState));
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue