Skip to content

Commit

Permalink
Updated unit test to check for signal id enrichment
Browse files Browse the repository at this point in the history
  • Loading branch information
donaherc committed Feb 23, 2022
1 parent f1a8c68 commit 5d0e015
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ describe('sendAlertTelemetry', () => {
data_stream: {
dataset: 'endpoint.events',
},
event: {
id: 'foo',
},
},
},
{
Expand All @@ -47,6 +50,9 @@ describe('sendAlertTelemetry', () => {
dataset: 'endpoint.alerts',
other: 'x',
},
event: {
id: 'bar',
},
},
},
{
Expand All @@ -58,12 +64,19 @@ describe('sendAlertTelemetry', () => {
'@timestamp': 'x',
key3: 'hello',
data_stream: {},
event: {
id: 'baz',
},
},
},
],
},
};
const joinMap = new Map<string, string>();
const joinMap = new Map<string, string>([
['foo', '1234'],
['bar', 'abcd'],
['baz', '4567'],
]);
const sources = selectEvents(filteredEvents, joinMap);
expect(sources).toStrictEqual([
{
Expand All @@ -73,6 +86,10 @@ describe('sendAlertTelemetry', () => {
dataset: 'endpoint.alerts',
other: 'x',
},
event: {
id: 'bar',
},
signal_id: 'abcd',
},
]);
});
Expand Down

0 comments on commit 5d0e015

Please sign in to comment.