mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
inform participants on UI too (#10473)
* inform participants on UI too * ajust test * refactor getParticipantIDsByIssue
This commit is contained in:
@@ -61,15 +61,17 @@ func TestGetIssuesByIDs(t *testing.T) {
|
||||
testSuccess([]int64{1, 2, 3}, []int64{NonexistentID})
|
||||
}
|
||||
|
||||
func TestGetParticipantsByIssueID(t *testing.T) {
|
||||
func TestGetParticipantIDsByIssue(t *testing.T) {
|
||||
assert.NoError(t, PrepareTestDatabase())
|
||||
|
||||
checkParticipants := func(issueID int64, userIDs []int) {
|
||||
participants, err := GetParticipantsByIssueID(issueID)
|
||||
issue, err := GetIssueByID(issueID)
|
||||
assert.NoError(t, err)
|
||||
participants, err := issue.getParticipantIDsByIssue(x)
|
||||
if assert.NoError(t, err) {
|
||||
participantsIDs := make([]int, len(participants))
|
||||
for i, u := range participants {
|
||||
participantsIDs[i] = int(u.ID)
|
||||
for i, uid := range participants {
|
||||
participantsIDs[i] = int(uid)
|
||||
}
|
||||
sort.Ints(participantsIDs)
|
||||
sort.Ints(userIDs)
|
||||
@@ -81,7 +83,7 @@ func TestGetParticipantsByIssueID(t *testing.T) {
|
||||
// User 2 only labeled issue1 (see fixtures/comment.yml)
|
||||
// Users 3 and 5 made actual comments (see fixtures/comment.yml)
|
||||
// User 3 is inactive, thus not active participant
|
||||
checkParticipants(1, []int{5})
|
||||
checkParticipants(1, []int{1, 5})
|
||||
}
|
||||
|
||||
func TestIssue_ClearLabels(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user