Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] Add functional test for wrapping labels #82453

Merged
merged 2 commits into from
Nov 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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