summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.codecov.yml8
-rw-r--r--app/command_channel_header_test.go28
2 files changed, 36 insertions, 0 deletions
diff --git a/.codecov.yml b/.codecov.yml
new file mode 100644
index 000000000..29fa07a58
--- /dev/null
+++ b/.codecov.yml
@@ -0,0 +1,8 @@
+coverage:
+ status:
+ project:
+ default:
+ threshold: 1%
+ patch: off
+ignore:
+ - store/storetest
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)
+ }
+}