* add tests

* pass userID to the function instead of the user object.

* remove concurrent login simulation

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Vishal
2024-10-22 12:21:36 +05:30
коммит произвёл GitHub
родитель 1a28bc2c58
Коммит cc5b3a2f69
9 изменённых файлов: 129 добавлений и 11 удалений

Просмотреть файл

@@ -2219,14 +2219,14 @@ func TestPatchUser(t *testing.T) {
require.Equal(t, "America/New_York", ruser.Timezone["automaticTimezone"], "automaticTimezone should update properly")
require.Empty(t, ruser.Timezone["manualTimezone"], "manualTimezone should update properly")
appErr := th.App.CheckPasswordAndAllCriteria(th.Context, user, *patch.Password, "")
appErr := th.App.CheckPasswordAndAllCriteria(th.Context, user.Id, *patch.Password, "")
require.NotNil(t, appErr, "Password should not match")
currentPassword := user.Password
user, appErr = th.App.GetUser(ruser.Id)
require.Nil(t, appErr)
appErr = th.App.CheckPasswordAndAllCriteria(th.Context, user, currentPassword, "")
appErr = th.App.CheckPasswordAndAllCriteria(th.Context, user.Id, currentPassword, "")
require.Nil(t, appErr, "Password should still match")
patch = &model.UserPatch{}