From 54a75753cd0f3608015772c3159bc1a05129918f Mon Sep 17 00:00:00 2001 From: Julia Date: Tue, 17 Dec 2024 20:58:23 +0100 Subject: [PATCH] fix brocken tests --- .../methods/find/find_maintenance_windows.test.ts | 8 ++++---- .../maintenance_window/find_maintenance_windows.ts | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/x-pack/plugins/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.test.ts b/x-pack/plugins/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.test.ts index 489d443725896..b1c85931f3f80 100644 --- a/x-pack/plugins/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.test.ts +++ b/x-pack/plugins/alerting/server/application/maintenance_window/methods/find/find_maintenance_windows.test.ts @@ -184,7 +184,7 @@ describe('getStatusFilter', () => { "type": "literal", "value": "maintenance-window.attributes.events", }, - "gte", + "gt", Object { "isQuoted": true, "type": "literal", @@ -275,14 +275,14 @@ describe('getStatusFilter', () => { }); it('return empty string if status does not exist', () => { - expect(getStatusFilter(['weird' as MaintenanceWindowStatus])).toMatchInlineSnapshot(`""`); + expect(getStatusFilter(['weird' as MaintenanceWindowStatus])).toBeUndefined(); }); it('return empty string if pass empty arguments', () => { - expect(getStatusFilter()).toMatchInlineSnapshot(`""`); + expect(getStatusFilter()).toBeUndefined(); }); it('return empty string if pass empty array', () => { - expect(getStatusFilter([])).toMatchInlineSnapshot(`""`); + expect(getStatusFilter([])).toBeUndefined(); }); }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/maintenance_window/find_maintenance_windows.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/maintenance_window/find_maintenance_windows.ts index a915c26ee579b..7c0067b159c8e 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/maintenance_window/find_maintenance_windows.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/maintenance_window/find_maintenance_windows.ts @@ -327,7 +327,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo .get( `${getUrlPrefix( space.id - )}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=running` + )}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=running` ) .set('kbn-xsrf', 'foo') .auth(user.username, user.password) @@ -342,7 +342,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo expect(response.body).to.eql({ error: 'Forbidden', message: - 'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=running] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]', + 'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=running] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]', statusCode: 403, }); break; @@ -417,7 +417,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo .get( `${getUrlPrefix( space.id - )}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=upcoming` + )}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=upcoming` ) .set('kbn-xsrf', 'foo') .auth(user.username, user.password) @@ -432,7 +432,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo expect(response.body).to.eql({ error: 'Forbidden', message: - 'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=upcoming] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]', + 'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=upcoming] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]', statusCode: 403, }); break; @@ -507,7 +507,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo .get( `${getUrlPrefix( space.id - )}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=running&statuses=finished` + )}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=running&status=finished` ) .set('kbn-xsrf', 'foo') .auth(user.username, user.password) @@ -522,7 +522,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo expect(response.body).to.eql({ error: 'Forbidden', message: - 'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=running&statuses=finished] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]', + 'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=running&status=finished] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]', statusCode: 403, }); break;