From 72267701ba996b71929028767a4aa76e204fce26 Mon Sep 17 00:00:00 2001 From: Candace Park Date: Tue, 22 Jun 2021 15:44:38 -0400 Subject: [PATCH] unit test wip --- .../common/utils/endpoint_alert_check.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 x-pack/plugins/security_solution/public/common/utils/endpoint_alert_check.test.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/endpoint_alert_check.test.ts b/x-pack/plugins/security_solution/public/common/utils/endpoint_alert_check.test.ts new file mode 100644 index 00000000000000..ad0f7a254cf3f4 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/utils/endpoint_alert_check.test.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { endpointAlertCheck } from './endpoint_alert_check'; + +describe('utils', () => { + describe('endpoinAlertCheck', () => { + it('should return true if detections data comes from an endpoint rule', () => { + expect(endpointAlertCheck(mockData)).toBeTruthy(); + }); + it('should return false if detections data does not come from endpoint rule', () => { + expect(endpointAlertCheck(mockDataWithout)).toBeFalsy(); + }); + }); +});