github.com/masterhung0112/hk_server/v5@v5.0.0-20220302090640-ec71aef15e1c/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/masterhung0112/hk_server/v5/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, th.Context, &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 }