Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.7] [Security Solution] Fixes bulk close alerts from exception flyout type bug (#150765) #150784

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,16 @@ describe('Exception helpers', () => {
const result = prepareExceptionItemsForBulkClose(payload);
expect(result).toEqual(expected);
});

test("should strip out any comments in the exceptions for bulk close'", () => {
const exceptionItemWithComment = {
...getExceptionListItemSchemaMock(),
comments: getCommentsArrayMock(),
};
const payload = [exceptionItemWithComment];
const result = prepareExceptionItemsForBulkClose(payload);
expect(result).toEqual([getExceptionListItemSchemaMock()]);
});
});

describe('#lowercaseHashValues', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ export const prepareExceptionItemsForBulkClose = (
return {
...item,
entries: newEntries,
comments: [], // Strips out unneeded comments attribute for bulk close as they are not needed and are throwing type errors
};
} else {
return item;
return { ...item, comments: [] };
}
});
};
Expand Down