update unit tests for default channels
Этот коммит содержится в:
@@ -35,8 +35,15 @@ func TestCreateChannel(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rget := Client.Must(Client.GetChannels("")).Data.(*model.ChannelList)
|
rget := Client.Must(Client.GetChannels("")).Data.(*model.ChannelList)
|
||||||
if rget.Channels[0].Name != channel.Name {
|
nameMatch := false
|
||||||
t.Fatal("full name didn't match")
|
for _, c := range rget.Channels {
|
||||||
|
if c.Name == channel.Name {
|
||||||
|
nameMatch = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !nameMatch {
|
||||||
|
t.Fatal("Did not create channel with correct name")
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := Client.CreateChannel(rchannel.Data.(*model.Channel)); err == nil {
|
if _, err := Client.CreateChannel(rchannel.Data.(*model.Channel)); err == nil {
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ func TestJoinCommands(t *testing.T) {
|
|||||||
|
|
||||||
c1 := Client.Must(Client.GetChannels("")).Data.(*model.ChannelList)
|
c1 := Client.Must(Client.GetChannels("")).Data.(*model.ChannelList)
|
||||||
|
|
||||||
if len(c1.Channels) != 3 { // 3 because of town-square and direct
|
if len(c1.Channels) != 4 { // 4 because of town-square, off-topic and direct
|
||||||
t.Fatal("didn't join channel")
|
t.Fatal("didn't join channel")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,11 @@ func TestCreateFromSignupTeam(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c1 := Client.Must(Client.GetChannels("")).Data.(*model.ChannelList)
|
||||||
|
if len(c1.Channels) != 2 {
|
||||||
|
t.Fatal("default channels not created")
|
||||||
|
}
|
||||||
|
|
||||||
ts.Data = "garbage"
|
ts.Data = "garbage"
|
||||||
_, err = Client.CreateTeamFromSignup(&ts)
|
_, err = Client.CreateTeamFromSignup(&ts)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@@ -71,6 +76,17 @@ func TestCreateTeam(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user := &model.User{TeamId: rteam.Data.(*model.Team).Id, Email: model.NewId() + "corey@test.com", FullName: "Corey Hulen", Password: "pwd"}
|
||||||
|
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
|
||||||
|
Srv.Store.User().VerifyEmail(user.Id)
|
||||||
|
|
||||||
|
Client.LoginByEmail(team.Domain, user.Email, "pwd")
|
||||||
|
|
||||||
|
c1 := Client.Must(Client.GetChannels("")).Data.(*model.ChannelList)
|
||||||
|
if len(c1.Channels) != 2 {
|
||||||
|
t.Fatal("default channels not created")
|
||||||
|
}
|
||||||
|
|
||||||
if rteam.Data.(*model.Team).Name != team.Name {
|
if rteam.Data.(*model.Team).Name != team.Name {
|
||||||
t.Fatal("full name didn't match")
|
t.Fatal("full name didn't match")
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user