Skip to content

Commit

Permalink
[Lens] Add functional test for wrapping labels (#82453)
Browse files Browse the repository at this point in the history
* add functional test for wrapping labels

* fix unused import
  • Loading branch information
flash1293 authored Nov 4, 2020
1 parent 2c61de1 commit 57f7401
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion x-pack/test/functional/apps/lens/smokescreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['visualize', 'lens', 'common']);
const PageObjects = getPageObjects(['visualize', 'lens', 'common', 'header']);
const find = getService('find');
const listingTable = getService('listingTable');
const testSubjects = getService('testSubjects');
Expand Down Expand Up @@ -169,6 +169,25 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(await PageObjects.lens.getDimensionTriggerText('lnsXY_yDimensionPanel')).to.eql(
'Test of label'
);
await PageObjects.lens.closeDimensionEditor();
});

it('should be able to add very long labels and still be able to remove a dimension', async () => {
await PageObjects.lens.openDimensionEditor('lnsXY_yDimensionPanel > lns-dimensionTrigger');
const longLabel =
'Veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryvery long label wrapping multiple lines';
await PageObjects.lens.editDimensionLabel(longLabel);
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.closeDimensionEditor();

expect(await PageObjects.lens.getDimensionTriggerText('lnsXY_yDimensionPanel')).to.eql(
longLabel
);
expect(
await testSubjects.isDisplayed('lnsXY_yDimensionPanel > indexPattern-dimension-remove')
).to.equal(true);
await PageObjects.lens.removeDimension('lnsXY_yDimensionPanel');
await testSubjects.missingOrFail('lnsXY_yDimensionPanel > lns-dimensionTrigger');
});

it('should transition from a multi-layer stacked bar to donut chart using suggestions', async () => {
Expand Down

0 comments on commit 57f7401

Please sign in to comment.