Skip to content

Commit

Permalink
Fix unit tests for rule updates
Browse files Browse the repository at this point in the history
Adding in the other required fields here to get a more concise error.
  • Loading branch information
rylnd committed Oct 30, 2020
1 parent 9f22c27 commit 21af052
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ describe('update rules schema', () => {
});

test('name cannot be an empty string', () => {
const payload: Partial<UpdateRulesSchema> = {
const payload: UpdateRulesSchema = {
description: 'some description',
name: '',
risk_score: 50,
severity: 'low',
type: 'query',
};

const decoded = updateRulesSchema.decode(payload);
Expand All @@ -138,8 +142,12 @@ describe('update rules schema', () => {
});

test('description cannot be an empty string', () => {
const payload: Partial<UpdateRulesSchema> = {
const payload: UpdateRulesSchema = {
description: '',
name: 'rule name',
risk_score: 50,
severity: 'low',
type: 'query',
};

const decoded = updateRulesSchema.decode(payload);
Expand Down

0 comments on commit 21af052

Please sign in to comment.