[MM-47824] fix promoteGuestToUserCmdF to handle the proper errors (#26397)

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
FutureFoodBanker
2024-03-22 20:42:37 +08:00
коммит произвёл GitHub
родитель 7337c384a8
Коммит 46bd4599f0
3 изменённых файлов: 11 добавлений и 6 удалений

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

@@ -2747,7 +2747,7 @@ func (s *MmctlUnitTestSuite) TestPromoteGuestToUserCmd() {
Times(1)
err := promoteGuestToUserCmdF(s.client, nil, []string{emailArg})
s.Require().NoError(err)
s.Require().ErrorContains(err, "unable to promote guest")
s.Require().Len(printer.GetLines(), 0)
s.Require().Len(printer.GetErrorLines(), 1)
s.Require().Equal(fmt.Sprintf("unable to promote guest %s: %s", emailArg, "some-error"), printer.GetErrorLines()[0])