Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wylieconlon committed Jun 29, 2021
1 parent d17f4dd commit 4be696b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions x-pack/test/functional/apps/lens/formula.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(await PageObjects.lens.getErrorCount()).to.eql(0);
});

it('should duplicate a moving average formula and be a valid table', async () => {
it('should duplicate a moving average formula and be a valid table with conditional coloring', async () => {
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickVisType('lens');
await PageObjects.lens.goToTimeRange();
Expand All @@ -198,14 +198,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
formula: `moving_average(sum(bytes), window=5`,
keepOpen: true,
});
await PageObjects.lens.setTableDynamicColoring('text');
await PageObjects.header.waitUntilLoadingHasFinished();
const styleObj = await PageObjects.lens.getDatatableCellStyle(1, 1);
expect(styleObj['background-color']).to.be(undefined);
expect(styleObj.color).not.to.be(undefined);

await PageObjects.lens.closeDimensionEditor();

await PageObjects.lens.dragDimensionToDimension(
'lnsDatatable_metrics > lns-dimensionTrigger',
'lnsDatatable_metrics > lns-empty-dimension'
);
expect(await PageObjects.lens.getDatatableCellText(1, 1)).to.eql('222420');
expect(await PageObjects.lens.getDatatableCellText(1, 2)).to.eql('222420');
expect(await PageObjects.lens.getDatatableCellText(1, 1)).to.eql('222,420');
expect(await PageObjects.lens.getDatatableCellText(1, 2)).to.eql('222,420');
});

it('should keep the formula if the user does not fully transition to a quick function', async () => {
Expand Down

0 comments on commit 4be696b

Please sign in to comment.