From 219018c041e7f5272adfaa41f90d88df3c86e8a0 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Mon, 25 Jul 2022 13:16:11 -0600 Subject: [PATCH] one more test --- .../cases_webhook/service.test.ts | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/actions/server/builtin_action_types/cases_webhook/service.test.ts b/x-pack/plugins/actions/server/builtin_action_types/cases_webhook/service.test.ts index ff91374c8dfac6..cf8464d71d8a2c 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/cases_webhook/service.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/cases_webhook/service.test.ts @@ -647,8 +647,8 @@ describe('Cases webhook service', () => { requestMock.mockImplementation(() => createAxiosResponse({ data: { - id: '1', - key: 'CK-1', + id: '../../malicious-app/malicious-endpoint/', + key: '../../malicious-app/malicious-endpoint/', fields: { updated: '2020-04-27T10:59:46.202Z', created: '2020-04-27T10:59:46.202Z', @@ -668,6 +668,23 @@ describe('Cases webhook service', () => { ); }); + test('createIncident- escapes url', async () => { + const incident = { + incident: { + title: 'title', + description: 'desc', + tags: ['hello', 'world'], + issueType: '10006', + priority: 'High', + parent: 'RJ-107', + }, + }; + const res = await service.createIncident(incident); + expect(res.url).toEqual( + 'https://siem-kibana.atlassian.net/browse/..%2F..%2Fmalicious-app%2Fmalicious-endpoint%2F' + ); + }); + test('updateIncident- escapes url', async () => { const incident = { incidentId: '../../malicious-app/malicious-endpoint/',