From 1c6e505b7c72424ab0c96b555c43f6acd23fcc76 Mon Sep 17 00:00:00 2001 From: Davis Plumlee Date: Mon, 9 Dec 2024 12:02:13 -0500 Subject: [PATCH] adds one more test --- .../lib/detection_engine/rule_types/utils/utils.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.test.ts index f95845151136..3430d2ae903e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.test.ts @@ -597,6 +597,11 @@ describe('utils', () => { const from = calculateFromValue('5m', '0m'); expect(from).toEqual('now-300s'); }); + + test('should return formatted `from` value from rule schedule fields with invalid moment fields', () => { + const from = calculateFromValue('5', '5'); + expect(from).toEqual('now-0s'); + }); }); describe('getMaxCatchupRatio', () => {