Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdjere committed Jul 19, 2024
1 parent c13c9e2 commit 3f0cc97
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ const reported = {
from: 'now-6m',
id: 'rule-id',
immutable: false,
rule_source: {
type: 'internal',
},
index: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'],
investigation_fields: undefined,
language: 'kuery',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ describe('normalizeRuleSource', () => {
});
expect(result).toEqual({
type: 'external',
is_customized: false,
isCustomized: false,
});
});

it('should return snake_case version of rule_source when ruleSource is present', () => {
it('should return existing value when ruleSource is present', () => {
const externalRuleSource: BaseRuleParams['ruleSource'] = {
type: 'external',
isCustomized: true,
};
const externalResult = normalizeRuleSource({ immutable: true, ruleSource: externalRuleSource });
expect(externalResult).toEqual({
type: externalRuleSource.type,
is_customized: externalRuleSource.isCustomized,
isCustomized: externalRuleSource.isCustomized,
});

const internalRuleSource: BaseRuleParams['ruleSource'] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ describe('buildAlert', () => {
},
],
immutable: false,
rule_source: {
type: 'internal',
},
type: 'query',
language: 'kuery',
index: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'],
Expand Down Expand Up @@ -357,6 +360,9 @@ describe('buildAlert', () => {
},
],
immutable: false,
rule_source: {
type: 'internal',
},
type: 'query',
language: 'kuery',
index: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'],
Expand Down

0 comments on commit 3f0cc97

Please sign in to comment.