-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Cases] Delete alerts when deleting all comments #154202
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
@@ -387,35 +386,6 @@ export default ({ getService }: FtrProviderContext): void => { | |||
}); | |||
}); | |||
|
|||
it('should delete multiple comments from the appropriate owner', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved all tests about deleteAllComments
to x-pack/test/cases_api_integration/security_and_spaces/tests/common/comments/delete_comments.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I preferred to create another file for the delete all cases comments API even though the code is very similar to the delete comment API. If you think otherwise let me know.
describe('alerts', () => { | ||
type Alerts = Array<{ _id: string; _index: string }>; | ||
|
||
const createCaseAttachAlertAndDeleteAlert = async ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is the same function as in delete_comment.ts
could we move it to a common place and use it in both files?
}); | ||
}); | ||
|
||
describe('alerts', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not too painful could we have a test that deletes all comments for a case that has some alerts and other comments?
And could we also add an expect that ensures all comments are removed (like delete comments, then do a find and make sure there are no comments for the case or something).
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @cnasikas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes!
Summary
This PR remove the case id from the alerts when deleting all cases comments
Checklist
Delete any items that are not applicable to this PR.
For maintainers