* add codecov yaml file

* ignore storetest directory

* add a test

* relax status checks a bit for now
Этот коммит содержится в:
Chris
2017-11-11 04:43:39 -06:00
коммит произвёл GitHub
родитель 756caaa1fb
Коммит ae8fd37332
2 изменённых файлов: 36 добавлений и 0 удалений

8
.codecov.yml Обычный файл
Просмотреть файл

@@ -0,0 +1,8 @@
coverage:
status:
project:
default:
threshold: 1%
patch: off
ignore:
- store/storetest

28
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)
}
}