github.com/adacta-ru/mattermost-server/v6@v6.0.0/app/slashcommands/command_me_test.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See LICENSE.txt for license information.
     3  
     4  package slashcommands
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/stretchr/testify/assert"
    10  
    11  	"github.com/adacta-ru/mattermost-server/v6/model"
    12  )
    13  
    14  func TestMeProviderDoCommand(t *testing.T) {
    15  	th := setup(t)
    16  	defer th.tearDown()
    17  
    18  	mp := MeProvider{}
    19  
    20  	msg := "hello"
    21  
    22  	resp := mp.DoCommand(th.App, &model.CommandArgs{}, msg)
    23  
    24  	assert.Equal(t, model.COMMAND_RESPONSE_TYPE_IN_CHANNEL, resp.ResponseType)
    25  	assert.Equal(t, model.POST_ME, resp.Type)
    26  	assert.Equal(t, "*"+msg+"*", resp.Text)
    27  	assert.Equal(t, model.StringInterface{
    28  		"message": msg,
    29  	}, resp.Props)
    30  }