Skip to content

Commit

Permalink
[Security Solution] Fixes bulk close alerts from exception flyout typ…
Browse files Browse the repository at this point in the history
…e bug (elastic#150765)
  • Loading branch information
dplumlee committed Feb 9, 2023
1 parent 20a9a01 commit 216fb3a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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

0 comments on commit 216fb3a

Please sign in to comment.