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
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
a760f32526
Коммит
66993e1fae
27
app/command_me_test.go
Обычный файл
27
app/command_me_test.go
Обычный файл
@@ -0,0 +1,27 @@
|
||||
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)
|
||||
}
|
||||
Ссылка в новой задаче
Block a user