Default Channel Functionality + Test Suite (#9068)
gofmt Make skipping for non public channels default Deduplication of Default Channels; Only post join to townsquare Post join channel message for all custom default channels
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
6104c37761
Коммит
3539a9a60b
@@ -163,6 +163,36 @@ func TestJoinDefaultChannelsCreatesChannelMemberHistoryRecordOffTopic(t *testing
|
||||
assert.True(t, found)
|
||||
}
|
||||
|
||||
func TestJoinDefaultChannelsExperimentalDefaultChannels(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
basicChannel2 := th.CreateChannel(th.BasicTeam)
|
||||
defaultChannelList := []string{th.BasicChannel.Name, basicChannel2.Name, basicChannel2.Name}
|
||||
th.App.Config().TeamSettings.ExperimentalDefaultChannels = defaultChannelList
|
||||
|
||||
user := th.CreateUser()
|
||||
th.App.JoinDefaultChannels(th.BasicTeam.Id, user, false, "")
|
||||
|
||||
for _, channelName := range defaultChannelList {
|
||||
channel, err := th.App.GetChannelByName(channelName, th.BasicTeam.Id)
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("Expected nil, got %s", err)
|
||||
}
|
||||
|
||||
member, err := th.App.GetChannelMember(channel.Id, user.Id)
|
||||
|
||||
if member == nil {
|
||||
t.Errorf("Expected member object, got nil")
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("Expected nil object, got %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateChannelPublicCreatesChannelMemberHistoryRecord(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
Ссылка в новой задаче
Block a user