mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* Don't allow d3-cloud to run on 0 size, fix #14833 * Add test that validates correct resizing
This commit is contained in:
parent
f0b5682c75
commit
0498c737cc
2 changed files with 16 additions and 0 deletions
|
@ -304,6 +304,12 @@ class TagCloud extends EventEmitter {
|
|||
|
||||
async _updateLayout(job) {
|
||||
|
||||
if (job.size[0] <= 0 || job.size[1] <= 0) {
|
||||
// If either width or height isn't above 0 we don't relayout anything,
|
||||
// since the d3-cloud will be stuck in an infinite loop otherwise.
|
||||
return;
|
||||
}
|
||||
|
||||
const mapSizeToFontSize = this._makeTextSizeMapper();
|
||||
const tagCloudLayoutGenerator = d3TagCloud();
|
||||
tagCloudLayoutGenerator.size(job.size);
|
||||
|
|
|
@ -3,6 +3,7 @@ import expect from 'expect.js';
|
|||
export default function ({ getService, getPageObjects }) {
|
||||
const filterBar = getService('filterBar');
|
||||
const log = getService('log');
|
||||
const remote = getService('remote');
|
||||
const retry = getService('retry');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header', 'settings']);
|
||||
|
||||
|
@ -72,6 +73,15 @@ export default function ({ getService, getPageObjects }) {
|
|||
expect(data).to.eql([ '32,212,254,720', '21,474,836,480', '20,401,094,656', '19,327,352,832', '18,253,611,008' ]);
|
||||
});
|
||||
|
||||
it('should still show all tags after browser was resized very small', async function () {
|
||||
await remote.setWindowSize(200, 200);
|
||||
await PageObjects.common.sleep(1000);
|
||||
await remote.setWindowSize(1200, 800);
|
||||
await PageObjects.common.sleep(1000);
|
||||
const data = await PageObjects.visualize.getTextTag();
|
||||
expect(data).to.eql([ '32,212,254,720', '21,474,836,480', '20,401,094,656', '19,327,352,832', '18,253,611,008' ]);
|
||||
});
|
||||
|
||||
it('should save and load', function () {
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(function (message) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue