Added Optional channel description name to channel creation, adjusted tests
All checks were successful
Build Docker and Deploy / Build Docker Container (push) Successful in 2m22s
Build Docker and Deploy / Deploy to Server (push) Successful in 11s

This commit is contained in:
2024-02-24 12:20:41 +01:00
parent 51f5f1005a
commit 77cfe75043
4 changed files with 44 additions and 7 deletions

View File

@@ -54,6 +54,16 @@ func TestCreateChannel(t *testing.T) {
tt.AssertMappedSet(t, "channels", []string{"asdf", "test"}, clist.Channels, "display_name")
tt.AssertMappedSet(t, "channels", []string{"asdf", "test"}, clist.Channels, "internal_name")
}
tt.RequestAuthPost[gin.H](t, admintok, baseUrl, fmt.Sprintf("/api/v2/users/%s/channels", uid), gin.H{
"name": "withdesc",
"description": "desc",
})
{
clist := tt.RequestAuthGet[chanlist](t, admintok, baseUrl, fmt.Sprintf("/api/v2/users/%s/channels", uid))
tt.AssertEqual(t, "chan.len", 3, len(clist.Channels))
tt.AssertEqual(t, "description_name", "desc", clist.Channels[2]["description_name"])
}
}
func TestCreateChannelNameTooLong(t *testing.T) {