mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-02 16:35:19 +02:00
inform participants on UI too (#10473)
* inform participants on UI too * ajust test * refactor getParticipantIDsByIssue
This commit is contained in:
parent
513b962c1d
commit
694f44660f
5 changed files with 54 additions and 28 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue