Files
mattermost/app/command_me_test.go
Donald Feury 66993e1fae MM-2954 - Add a separate post type for /me messages and update formatting (#11082)
* MM-2954

* Added new const post type for /me commands
* Modified me command to return response text without *__* wrapper
* Modified unit test for MeCommand to reflect changes
* Added unit test for the me command provider

* * Reverted change to text property in me command response
* Added original message in me command response props
* Updated unit tests

* gofmt changes
2019-06-20 17:16:36 -04:00

28 lines
552 B
Go

package app
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/mattermost/mattermost-server/model"
)
func TestMeProviderDoCommand(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
mp := MeProvider{}
msg := "hello"
resp := mp.DoCommand(th.App, &model.CommandArgs{}, msg)
assert.Equal(t, model.COMMAND_RESPONSE_TYPE_IN_CHANNEL, resp.ResponseType)
assert.Equal(t, model.POST_ME, resp.Type)
assert.Equal(t, "*"+msg+"*", resp.Text)
assert.Equal(t, model.StringInterface{
"message": msg,
}, resp.Props)
}