Skip to content

Commit

Permalink
clenup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed Jul 13, 2020
1 parent b5a367e commit 10ab256
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/plugins/vis_type_vega/public/vega_visualization.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ describe('VegaVisualizations', () => {
const coreStart = coreMock.createStart();
const dataPluginStart = dataPluginMock.createStartContract();

const setupDOM = (width, height) => {
domNode = document.createElement('div');
mockWidth = jest.spyOn($.prototype, 'width').mockReturnValue(width);
mockHeight = jest.spyOn($.prototype, 'height').mockReturnValue(height);
};

setKibanaMapFactory((...args) => new KibanaMap(...args));
setInjectedVars({
emsTileLayerId: {},
Expand Down Expand Up @@ -127,8 +133,8 @@ describe('VegaVisualizations', () => {
mockHeight.mockRestore();
mockHeight = jest.spyOn($.prototype, 'height').mockReturnValue(256);

vegaVis._vegaView.resize();
await vegaVis.render(vegaParser);
await vegaVis._vegaView.resize();

expect(domNode.innerHTML).toMatchSnapshot();
} finally {
vegaVis.destroy();
Expand Down Expand Up @@ -230,10 +236,4 @@ describe('VegaVisualizations', () => {
}
});
});

function setupDOM(width, height) {
domNode = document.createElement('div');
mockWidth = jest.spyOn($.prototype, 'width').mockReturnValue(width);
mockHeight = jest.spyOn($.prototype, 'height').mockReturnValue(height);
}
});

0 comments on commit 10ab256

Please sign in to comment.