2016-05-19 07:35:12 -04:00
|
|
|
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
|
|
|
|
package api
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/mattermost/platform/model"
|
|
|
|
|
"strings"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestShortcutsCommand(t *testing.T) {
|
|
|
|
|
th := Setup().InitBasic()
|
|
|
|
|
Client := th.BasicClient
|
|
|
|
|
channel := th.BasicChannel
|
|
|
|
|
|
2016-12-10 13:35:16 +09:00
|
|
|
rs := Client.Must(Client.Command(channel.Id, "/shortcuts ")).Data.(*model.CommandResponse)
|
2016-07-14 15:57:06 -04:00
|
|
|
if !strings.Contains(rs.Text, "CTRL") {
|
2016-05-19 07:35:12 -04:00
|
|
|
t.Fatal("failed to display shortcuts")
|
|
|
|
|
}
|
2016-07-14 15:57:06 -04:00
|
|
|
|
2016-12-10 13:35:16 +09:00
|
|
|
rs = Client.Must(Client.Command(channel.Id, "/shortcuts mac")).Data.(*model.CommandResponse)
|
2016-07-14 15:57:06 -04:00
|
|
|
if !strings.Contains(rs.Text, "CMD") {
|
|
|
|
|
t.Fatal("failed to display Mac shortcuts")
|
|
|
|
|
}
|
2016-05-19 07:35:12 -04:00
|
|
|
}
|