mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* 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
28 lines
552 B
Go
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)
|
|
}
|