Tests[SendToNewChannel]

This commit is contained in:
2022-12-14 14:30:34 +01:00
parent 66ecad27a7
commit f1e87170f0
3 changed files with 83 additions and 3 deletions
+2 -3
View File
@@ -5,7 +5,6 @@ import (
tt "blackforestbytes.com/simplecloudnotifier/test/util"
"fmt"
"github.com/gin-gonic/gin"
"gogs.mikescher.com/BlackForestBytes/goext/langext"
"gogs.mikescher.com/BlackForestBytes/goext/timeext"
"net/url"
"testing"
@@ -26,8 +25,8 @@ func TestSearchMessageFTSSimple(t *testing.T) {
msgList := tt.RequestAuthGet[mglist](t, data.User[0].AdminKey, baseUrl, fmt.Sprintf("/api/messages?filter=%s", url.QueryEscape("Friday")))
tt.AssertEqual(t, "msgList.len", 2, len(msgList.Messages))
tt.AssertTrue(t, "msgList.any<1>", langext.ArrAny(msgList.Messages, func(msg gin.H) bool { return msg["title"].(string) == "Invitation" }))
tt.AssertTrue(t, "msgList.any<2>", langext.ArrAny(msgList.Messages, func(msg gin.H) bool { return msg["title"].(string) == "Important notice" }))
tt.AssertArrAny(t, "msgList.any<1>", msgList.Messages, func(msg gin.H) bool { return msg["title"].(string) == "Invitation" })
tt.AssertArrAny(t, "msgList.any<2>", msgList.Messages, func(msg gin.H) bool { return msg["title"].(string) == "Important notice" })
}
func TestSearchMessageFTSMulti(t *testing.T) {