Skip to content

Commit

Permalink
fix: use correct DNS field id
Browse files Browse the repository at this point in the history
  • Loading branch information
janmonschke committed Feb 8, 2022
1 parent e312c36 commit 2adb9e1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,40 @@ describe('AlertSummaryView', () => {
expect(getByText(fieldId));
});
});

test('DNS event renders the correct summary rows', () => {
const renderProps = {
...props,
data: [
...(mockAlertDetailsData.map((item) => {
if (item.category === 'event' && item.field === 'event.category') {
return {
...item,
values: ['dns'],
originalValue: ['dns'],
};
}
return item;
}) as TimelineEventsDetailsItem[]),
{
category: 'dns',
field: 'dns.question.name',
values: ['www.example.com'],
originalValue: ['www.example.com'],
} as TimelineEventsDetailsItem,
],
};
const { getByText } = render(
<TestProvidersComponent>
<AlertSummaryView {...renderProps} />
</TestProvidersComponent>
);

['dns.question.name', 'process.name'].forEach((fieldId) => {
expect(getByText(fieldId));
});
});

test('Memory event code renders additional summary rows', () => {
const renderProps = {
...props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function getFieldsByCategory({
{ id: 'process.name' },
];
case EventCategory.DNS:
return [{ id: 'dns.query.name' }, { id: 'process.name' }];
return [{ id: 'dns.question.name' }, { id: 'process.name' }];
case EventCategory.REGISTRY:
return [{ id: 'registry.key' }, { id: 'registry.value' }, { id: 'process.name' }];
case EventCategory.MALWARE:
Expand Down

0 comments on commit 2adb9e1

Please sign in to comment.