diff options
author | Chris <ccbrown112@gmail.com> | 2017-11-11 04:43:39 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-11 04:43:39 -0600 |
commit | ae8fd37332ad9f01b762ab37f5662cdd33f1e232 (patch) | |
tree | 976f5684405adf5abf4531d70fd5ead7106b1195 /app/command_channel_header_test.go | |
parent | 756caaa1fb29faab06f6f8e4c9258ccfc3c5d4dc (diff) | |
download | chat-ae8fd37332ad9f01b762ab37f5662cdd33f1e232.tar.gz chat-ae8fd37332ad9f01b762ab37f5662cdd33f1e232.tar.bz2 chat-ae8fd37332ad9f01b762ab37f5662cdd33f1e232.zip |
Add codecov yaml file (#7818)
* add codecov yaml file
* ignore storetest directory
* add a test
* relax status checks a bit for now
Diffstat (limited to 'app/command_channel_header_test.go')
-rw-r--r-- | app/command_channel_header_test.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/command_channel_header_test.go b/app/command_channel_header_test.go new file mode 100644 index 000000000..5fdde122b --- /dev/null +++ b/app/command_channel_header_test.go @@ -0,0 +1,28 @@ +package app + +import ( + "testing" + + "github.com/mattermost/mattermost-server/model" + "github.com/stretchr/testify/assert" +) + +func TestHeaderProviderDoCommand(t *testing.T) { + th := Setup().InitBasic() + defer th.TearDown() + + hp := HeaderProvider{} + args := &model.CommandArgs{ + T: func(s string, args ...interface{}) string { return s }, + ChannelId: th.BasicChannel.Id, + Session: model.Session{UserId: th.BasicUser.Id, TeamMembers: []*model.TeamMember{{TeamId: th.BasicTeam.Id, Roles: model.ROLE_TEAM_USER.Id}}}, + } + + for msg, expected := range map[string]string{ + "": "api.command_channel_header.message.app_error", + "hello": "", + } { + actual := hp.DoCommand(th.App, args, msg).Text + assert.Equal(t, expected, actual) + } +} |