From 21af052b6185512812b532727a3217b3f87a4a97 Mon Sep 17 00:00:00 2001 From: Ryland Herrick Date: Fri, 30 Oct 2020 14:27:27 -0500 Subject: [PATCH] Fix unit tests for rule updates Adding in the other required fields here to get a more concise error. --- .../schemas/request/update_rules_schema.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_schema.test.ts index c3e7a7de8d571..e3347b41ac0fa 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_schema.test.ts @@ -126,8 +126,12 @@ describe('update rules schema', () => { }); test('name cannot be an empty string', () => { - const payload: Partial = { + const payload: UpdateRulesSchema = { + description: 'some description', name: '', + risk_score: 50, + severity: 'low', + type: 'query', }; const decoded = updateRulesSchema.decode(payload); @@ -138,8 +142,12 @@ describe('update rules schema', () => { }); test('description cannot be an empty string', () => { - const payload: Partial = { + const payload: UpdateRulesSchema = { description: '', + name: 'rule name', + risk_score: 50, + severity: 'low', + type: 'query', }; const decoded = updateRulesSchema.decode(payload);