Skip to content

Commit dbfba37

Browse files
committed
fix and extend test
1 parent 14bd6af commit dbfba37

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

models/issues/pull_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,20 @@ func TestGetApprovers(t *testing.T) {
349349
expected := "Reviewed-by: User Five <[email protected]>\nReviewed-by: Org Six <[email protected]>\n"
350350
assert.Equal(t, expected, approvers)
351351

352-
// ( TODO(#35500): dismissed, ) comment-type and pending reviews should be ignored
352+
// comment-type and pending reviews should be ignored
353+
pr = unittest.AssertExistsAndLoadBean(t, &issues_model.PullRequest{ID: 2})
354+
assert.EqualValues(t, 3, pr.IssueID)
355+
setting.Repository.PullRequest.DefaultMergeMessageOfficialApproversOnly = false
356+
approvers = pr.GetApprovers(t.Context())
357+
expected = "Reviewed-by: User Five <[email protected]>\nReviewed-by: user4 <[email protected]>\n"
358+
assert.Equal(t, expected, approvers)
359+
360+
// un-official reviews should now be ignored too
353361
pr = unittest.AssertExistsAndLoadBean(t, &issues_model.PullRequest{ID: 2})
354362
assert.EqualValues(t, 3, pr.IssueID)
355363
setting.Repository.PullRequest.DefaultMergeMessageOfficialApproversOnly = true
356364
approvers = pr.GetApprovers(t.Context())
357-
expected = "Reviewed-by: User Five <[email protected]>\n" + // TODO(#35500): remove user 5
358-
"Reviewed-by: user4 <[email protected]>\n"
365+
expected = ""
359366
assert.Equal(t, expected, approvers)
360367
}
361368

0 commit comments

Comments
 (0)