Backport #30556 by @lunny Fix #22419 Only comments with types `CommentTypeComment` and `CommentTypeReview` will be counted as conversations of the pull request. `CommentTypeReview` was missed in the previous implementation. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
27de60381d
commit
968c04c7da
5 changed files with 89 additions and 19 deletions
|
@ -97,3 +97,12 @@ func TestMigrate_InsertIssueComments(t *testing.T) {
|
|||
|
||||
unittest.CheckConsistencyFor(t, &issues_model.Issue{})
|
||||
}
|
||||
|
||||
func Test_UpdateIssueNumComments(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
issue2 := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 2})
|
||||
|
||||
assert.NoError(t, issues_model.UpdateIssueNumComments(db.DefaultContext, issue2.ID))
|
||||
issue2 = unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 2})
|
||||
assert.EqualValues(t, 1, issue2.NumComments)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue