[MM-36318] Set bot profile image and icon only if they have changed (#18008)
* Set bot profile image and icon only if they have changed * Move equality check to the app layer * Use ioutil.ReadAll Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2982cc6f4e
Коммит
868b8d91db
@@ -3265,6 +3265,17 @@ func TestSetProfileImage(t *testing.T) {
|
||||
|
||||
ruser, appErr := th.App.GetUser(user.Id)
|
||||
require.Nil(t, appErr)
|
||||
assert.True(t, buser.LastPictureUpdate == ruser.LastPictureUpdate, "Same picture should not have updated")
|
||||
|
||||
data2, err := testutils.ReadTestFile("testjpg.jpg")
|
||||
require.NoError(t, err)
|
||||
|
||||
_, resp = th.SystemAdminClient.SetProfileImage(user.Id, data2)
|
||||
CheckNoError(t, resp)
|
||||
|
||||
ruser, appErr = th.App.GetUser(user.Id)
|
||||
require.Nil(t, appErr)
|
||||
|
||||
assert.True(t, buser.LastPictureUpdate < ruser.LastPictureUpdate, "Picture should have updated for user")
|
||||
|
||||
info := &model.FileInfo{Path: "users/" + user.Id + "/profile.png"}
|
||||
|
||||
Ссылка в новой задаче
Block a user