mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-18816 Adding ability to add users as another user to the plugin API. (#12562)
* Adding ability to add users as anouther user to the plugin API. * Documentation feedback.
This commit is contained in:
committed by
GitHub
parent
d7ee3553fa
commit
e62471dff6
@@ -1439,3 +1439,15 @@ func TestPluginAPIGetUnsanitizedConfig(t *testing.T) {
|
||||
assert.NotEqual(t, config.SqlSettings.DataSourceSearchReplicas[i], model.FAKE_SETTING)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPluginAddUserToChannel(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
api := th.SetupPluginAPI()
|
||||
|
||||
member, err := api.AddUserToChannel(th.BasicChannel.Id, th.BasicUser.Id, th.BasicUser2.Id)
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, member)
|
||||
require.Equal(t, th.BasicChannel.Id, member.ChannelId)
|
||||
require.Equal(t, th.BasicUser.Id, member.UserId)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user