From 4a9f60d3999121f74fd897a09aa8ac10a93d3932 Mon Sep 17 00:00:00 2001 From: Jiawei Wu Date: Mon, 17 Oct 2022 19:41:52 -0700 Subject: [PATCH] Fix tests --- .../public/application/lib/rule_api/get_filter.ts | 2 +- .../lib/rule_api/load_execution_log_aggregations.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_filter.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_filter.ts index 64fb650818517..a8681dcb8d4ac 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_filter.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_filter.ts @@ -40,5 +40,5 @@ function getOutcomeFilter(outcomeFilter: string[]) { success: 'kibana.alerting.outcome:success OR (event.outcome: success AND NOT kibana.alerting.outcome:*)', }; - return `${outcomeFilter.map((f) => filterMapping[f]).join(' OR ')}`; + return `(${outcomeFilter.map((f) => filterMapping[f]).join(' OR ')})`; } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.test.ts index de7452d6e114c..43655ff21e3bb 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.test.ts @@ -47,7 +47,7 @@ describe('loadExecutionLogAggregations', () => { id: 'test-id', dateStart: '2022-03-23T16:17:53.482Z', dateEnd: '2022-03-23T16:17:53.482Z', - outcomeFilter: ['success', 'unknown'], + outcomeFilter: ['success', 'warning'], message: 'test-message', perPage: 10, page: 0, @@ -85,7 +85,7 @@ describe('loadExecutionLogAggregations', () => { "query": Object { "date_end": "2022-03-23T16:17:53.482Z", "date_start": "2022-03-23T16:17:53.482Z", - "filter": "(message: \\"test-message\\" OR error.message: \\"test-message\\") and (event.outcome: success or unknown)", + "filter": "(message: \\"test-message\\" OR error.message: \\"test-message\\") and (kibana.alerting.outcome:success OR (event.outcome: success AND NOT kibana.alerting.outcome:*) OR kibana.alerting.outcome: warning)", "page": 1, "per_page": 10, "sort": "[{\\"timestamp\\":{\\"order\\":\\"asc\\"}}]",