summaryrefslogtreecommitdiffstats
path: root/api/command_shortcuts_test.go
blob: 049175ec92229bbab980faeb0e57c8cb40b4165b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// 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

	rs := Client.Must(Client.Command(channel.Id, "/shortcuts ")).Data.(*model.CommandResponse)
	if !strings.Contains(rs.Text, "CTRL") {
		t.Fatal("failed to display shortcuts")
	}

	rs = Client.Must(Client.Command(channel.Id, "/shortcuts mac")).Data.(*model.CommandResponse)
	if !strings.Contains(rs.Text, "CMD") {
		t.Fatal("failed to display Mac shortcuts")
	}
}