From 34740e471427883510278762c2795bd6e613600f Mon Sep 17 00:00:00 2001 From: Alison Goryachev Date: Thu, 16 Apr 2020 10:07:22 -0400 Subject: [PATCH] fix tests --- .../management/ingest_pipelines/ingest_pipelines.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/x-pack/test/api_integration/apis/management/ingest_pipelines/ingest_pipelines.ts b/x-pack/test/api_integration/apis/management/ingest_pipelines/ingest_pipelines.ts index b972852d0a2141..a1773a052ede26 100644 --- a/x-pack/test/api_integration/apis/management/ingest_pipelines/ingest_pipelines.ts +++ b/x-pack/test/api_integration/apis/management/ingest_pipelines/ingest_pipelines.ts @@ -226,14 +226,18 @@ export default function({ getService }: FtrProviderContext) { const uri = `${API_BASE_PATH}/${PIPELINE_ONE_ID},${PIPELINE_TWO_ID}`; - const { body } = await supertest + const { + body: { itemsDeleted, errors }, + } = await supertest .delete(uri) .set('kbn-xsrf', 'xxx') .expect(200); - expect(body).to.eql({ - itemsDeleted: [PIPELINE_ONE_ID, PIPELINE_TWO_ID], - errors: [], + expect(errors).to.eql([]); + + // The itemsDeleted array order isn't guaranteed, so we assert against each pipeline name instead + [PIPELINE_ONE_ID, PIPELINE_TWO_ID].forEach(pipelineName => { + expect(itemsDeleted.includes(pipelineName)).to.be(true); }); });