From 2b86bcb1ec5c3abe699844f7519839626afa1759 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Tue, 14 Jan 2020 14:26:59 +0100 Subject: [PATCH] Address review feedback --- .../anomaly_detection/anomaly_explorer.ts | 4 ++-- .../anomaly_detection/single_metric_viewer.ts | 2 +- .../services/machine_learning/job_selection.ts | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/anomaly_explorer.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/anomaly_explorer.ts index 435de7ef3159a5..047efc1374134b 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/anomaly_explorer.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/anomaly_explorer.ts @@ -64,7 +64,7 @@ export default function({ getService }: FtrProviderContext) { }); it('pre-fills the job selection', async () => { - await ml.jobSelection.assertSelectedJobBadges([JOB_CONFIG.job_id]); + await ml.jobSelection.assertJobSelection([JOB_CONFIG.job_id]); }); it('displays the influencers list', async () => { @@ -75,7 +75,7 @@ export default function({ getService }: FtrProviderContext) { } }); - it('displays the swim lanes', async () => { + it('displays the swimlanes', async () => { await ml.anomalyExplorer.assertOverallSwimlaneExists(); await ml.anomalyExplorer.assertSwimlaneViewByExists(); }); diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_viewer.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_viewer.ts index c6f1c0f1142d02..a4d5bd4a5a0bcb 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_viewer.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_viewer.ts @@ -64,7 +64,7 @@ export default function({ getService }: FtrProviderContext) { }); it('pre-fills the job selection', async () => { - await ml.jobSelection.assertSelectedJobBadges([JOB_CONFIG.job_id]); + await ml.jobSelection.assertJobSelection([JOB_CONFIG.job_id]); }); it('pre-fills the detector input', async () => { diff --git a/x-pack/test/functional/services/machine_learning/job_selection.ts b/x-pack/test/functional/services/machine_learning/job_selection.ts index 169b109a476533..db693a8f9bb99e 100644 --- a/x-pack/test/functional/services/machine_learning/job_selection.ts +++ b/x-pack/test/functional/services/machine_learning/job_selection.ts @@ -11,16 +11,16 @@ export function MachineLearningJobSelectionProvider({ getService }: FtrProviderC const testSubjects = getService('testSubjects'); return { - async assertSelectedJobBadges(expectedBadgesLabels: string[]) { - const selectedBadges = await testSubjects.findAll( + async assertJobSelection(jobOrGroupIds: string[]) { + const selectedJobsOrGroups = await testSubjects.findAll( 'mlJobSelectionBadges > ~mlJobSelectionBadge' ); - const actualBadgesLabels = await Promise.all( - selectedBadges.map(async badge => await badge.getVisibleText()) + const actualJobOrGroupLabels = await Promise.all( + selectedJobsOrGroups.map(async badge => await badge.getVisibleText()) ); - expect(actualBadgesLabels).to.eql( - expectedBadgesLabels, - `Job selection should display badges '${expectedBadgesLabels}' (got '${actualBadgesLabels}')` + expect(actualJobOrGroupLabels).to.eql( + jobOrGroupIds, + `Job selection should display jobs or groups '${jobOrGroupIds}' (got '${actualJobOrGroupLabels}')` ); }, };