Skip to content

Commit

Permalink
Fix FTs
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Apr 6, 2023
1 parent aa91d86 commit 04c0452
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

it('area, bar and heatmap charts', async () => {
await dashboardExpect.seriesElementCount(2);
await dashboardExpect.heatmapXAxisBuckets(11);
});

it('data tables', async () => {
Expand Down
7 changes: 7 additions & 0 deletions test/functional/services/dashboard/expectations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,16 @@ export class DashboardExpectService extends FtrService {
async seriesElementCount(expectedCount: number) {
this.log.debug(`DashboardExpect.seriesElementCount(${expectedCount})`);
const heatmapData = await this.elasticChart.getChartDebugData('heatmapChart');
this.log.debug(heatmapData.axes?.y[0]);
expect(heatmapData.axes?.y[0].labels.length).to.be(expectedCount);
}

async heatmapXAxisBuckets(expectedCount: number) {
this.log.debug(`DashboardExpect.heatmapXAxisBuckets(${expectedCount})`);
const heatmapData = await this.elasticChart.getChartDebugData('heatmapChart');
expect(heatmapData.axes?.x[0].labels.length).to.be(expectedCount);
}

async heatMapNoResults() {
await this.testSubjects.find('heatmapChart>emptyPlaceholder');
}
Expand Down
8 changes: 8 additions & 0 deletions x-pack/test/functional/apps/visualize/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.importExport.load(
`x-pack/test/functional/fixtures/kbn_archiver/dashboard/with_by_value_visualizations`
);
await kibanaServer.uiSettings.update({
'histogram:maxBars': 100,
'visualization:visualize:legacyHeatmapChartsLibrary': true,
});

await retry.try(async () => {
await PageObjects.common.navigateToApp('dashboard');
Expand All @@ -49,6 +53,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.importExport.unload(
'x-pack/test/functional/fixtures/kbn_archiver/dashboard/with_by_value_visualizations'
);
await kibanaServer.uiSettings.update({
'histogram:maxBars': 1000,
'visualization:visualize:legacyHeatmapChartsLibrary': false,
});
await kibanaServer.savedObjects.cleanStandardList();
});

Expand Down

0 comments on commit 04c0452

Please sign in to comment.