Fix TestSendNotifications test (#8712)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
62898f4892
Коммит
ffb834ec3c
@@ -37,7 +37,7 @@ func TestSendNotifications(t *testing.T) {
|
|||||||
} else if mentions == nil {
|
} else if mentions == nil {
|
||||||
t.Log(mentions)
|
t.Log(mentions)
|
||||||
t.Fatal("user should have been mentioned")
|
t.Fatal("user should have been mentioned")
|
||||||
} else if mentions[0] != th.BasicUser2.Id {
|
} else if !utils.StringInSlice(th.BasicUser2.Id, mentions) {
|
||||||
t.Log(mentions)
|
t.Log(mentions)
|
||||||
t.Fatal("user should have been mentioned")
|
t.Fatal("user should have been mentioned")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,15 @@ import (
|
|||||||
"github.com/mattermost/mattermost-server/model"
|
"github.com/mattermost/mattermost-server/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func StringInSlice(a string, slice []string) bool {
|
||||||
|
for _, b := range slice {
|
||||||
|
if b == a {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func StringArrayIntersection(arr1, arr2 []string) []string {
|
func StringArrayIntersection(arr1, arr2 []string) []string {
|
||||||
arrMap := map[string]bool{}
|
arrMap := map[string]bool{}
|
||||||
result := []string{}
|
result := []string{}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user