add /open command (#6717)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
e285839ee1
Коммит
14467ee134
@@ -10,7 +10,8 @@ import (
|
||||
"github.com/mattermost/platform/model"
|
||||
)
|
||||
|
||||
func TestJoinCommands(t *testing.T) {
|
||||
// also used to test /open (see command_open_test.go)
|
||||
func testJoinCommands(t *testing.T, alias string) {
|
||||
th := Setup().InitBasic()
|
||||
Client := th.BasicClient
|
||||
team := th.BasicTeam
|
||||
@@ -29,12 +30,12 @@ func TestJoinCommands(t *testing.T) {
|
||||
|
||||
channel3 := Client.Must(Client.CreateDirectChannel(user2.Id)).Data.(*model.Channel)
|
||||
|
||||
rs5 := Client.Must(Client.Command(channel0.Id, "/join "+channel2.Name)).Data.(*model.CommandResponse)
|
||||
rs5 := Client.Must(Client.Command(channel0.Id, "/"+alias+" "+channel2.Name)).Data.(*model.CommandResponse)
|
||||
if !strings.HasSuffix(rs5.GotoLocation, "/"+team.Name+"/channels/"+channel2.Name) {
|
||||
t.Fatal("failed to join channel")
|
||||
}
|
||||
|
||||
rs6 := Client.Must(Client.Command(channel0.Id, "/join "+channel3.Name)).Data.(*model.CommandResponse)
|
||||
rs6 := Client.Must(Client.Command(channel0.Id, "/"+alias+" "+channel3.Name)).Data.(*model.CommandResponse)
|
||||
if strings.HasSuffix(rs6.GotoLocation, "/"+team.Name+"/channels/"+channel3.Name) {
|
||||
t.Fatal("should not have joined direct message channel")
|
||||
}
|
||||
@@ -52,3 +53,7 @@ func TestJoinCommands(t *testing.T) {
|
||||
t.Fatal("did not join channel")
|
||||
}
|
||||
}
|
||||
|
||||
func TestJoinCommands(t *testing.T) {
|
||||
testJoinCommands(t, "join")
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user