[MM-47821]: fix searchUserCmdF to return proper errors (#24700)

* fix: fix searchUserCmdF to return proper errors

* fix: fix broken tests

* fix: fix go-ci issues

* fix: fix more broken tests

* fix: fix wrong function call on error getting user test

* fix: fix e2e test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Neto Costa
2023-10-25 15:56:12 -03:00
коммит произвёл GitHub
родитель f01e8f6c6d
Коммит 00108d44bb
3 изменённых файлов: 73 добавлений и 3 удалений

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

@@ -134,7 +134,7 @@ func (s *MmctlE2ETestSuite) TestSearchUserCmd() {
emailArg := "nonexistentUser@example.com"
err := searchUserCmdF(c, &cobra.Command{}, []string{emailArg})
s.Require().Nil(err)
s.Require().Error(err)
s.Len(printer.GetLines(), 0)
s.Len(printer.GetErrorLines(), 1)
s.Equal(fmt.Sprintf("1 error occurred:\n\t* user %s not found\n\n", emailArg), printer.GetErrorLines()[0])