mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 01:45:22 +02:00
fix: cancel a review (#7454)
- Fixes #7152 - If a review no longer has any pending comments, remove that review from the database. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7454 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Leni Kadali <lenikadali@noreply.codeberg.org> Co-committed-by: Leni Kadali <lenikadali@noreply.codeberg.org>
This commit is contained in:
parent
4183fa9a03
commit
f4af3191ef
2 changed files with 25 additions and 1 deletions
|
@ -69,6 +69,7 @@ func TestDeleteComment(t *testing.T) {
|
|||
}))
|
||||
hookTaskCount := unittest.GetCount(t, &webhook_model.HookTask{})
|
||||
|
||||
require.NoError(t, comment.LoadReview(t.Context()))
|
||||
require.NoError(t, issue_service.DeleteComment(db.DefaultContext, nil, comment))
|
||||
|
||||
// The comment doesn't exist anymore.
|
||||
|
@ -77,6 +78,8 @@ func TestDeleteComment(t *testing.T) {
|
|||
assert.Equal(t, issue.NumComments, unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID}).NumComments)
|
||||
// No notification was fired for the deletion of this comment.
|
||||
assert.Equal(t, hookTaskCount, unittest.GetCount(t, &webhook_model.HookTask{}))
|
||||
// The review doesn't exist anymore.
|
||||
unittest.AssertNotExistsBean(t, &issues_model.Review{ID: comment.ReviewID})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue