summaryrefslogtreecommitdiffstats
path: root/api/command_shortcuts_test.go
blob: 01c56b465a356b6c7e9c995570b87b239ab16d32 (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 ", false)).Data.(*model.CommandResponse)
	if !strings.Contains(rs.Text, "CTRL") {
		t.Fatal("failed to display shortcuts")
	}

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