diff --git a/x-pack/test/functional/apps/lens/smokescreen.ts b/x-pack/test/functional/apps/lens/smokescreen.ts index 0ddafe581c21d..58ae4dc25885a 100644 --- a/x-pack/test/functional/apps/lens/smokescreen.ts +++ b/x-pack/test/functional/apps/lens/smokescreen.ts @@ -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'); @@ -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 () => {