[MM-14719] convert users to bots through cmd (#10672)
* [MM-14719] convert users to bots through cmd * address review comments, add / fix unit tests * change command from "modify" to "convert"; review comments * code review comments, clean up
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
dce6cb601f
Коммит
fc15eda37f
@@ -517,6 +517,23 @@ func TestUserFromBot(t *testing.T) {
|
||||
}, UserFromBot(bot2))
|
||||
}
|
||||
|
||||
func TestBotFromUser(t *testing.T) {
|
||||
user := &User{
|
||||
Id: NewId(),
|
||||
Username: "username",
|
||||
CreateAt: 1,
|
||||
UpdateAt: 2,
|
||||
DeleteAt: 3,
|
||||
}
|
||||
|
||||
assert.Equal(t, &Bot{
|
||||
OwnerId: user.Id,
|
||||
UserId: user.Id,
|
||||
Username: "username",
|
||||
DisplayName: "username",
|
||||
}, BotFromUser(user))
|
||||
}
|
||||
|
||||
func TestBotListToAndFromJson(t *testing.T) {
|
||||
testCases := []struct {
|
||||
Description string
|
||||
|
||||
Ссылка в новой задаче
Block a user