[MM-56061] Only render where field in model.AppError when it's present (#25648)

* Only render where field in model.AppError when it's present

* Remove trailing comma from permission error
Этот коммит содержится в:
Ben Schumacher
2023-12-11 10:27:51 +01:00
коммит произвёл GitHub
родитель a54f927e3d
Коммит 5b6b425cfc
27 изменённых файлов: 150 добавлений и 106 удалений

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

@@ -183,7 +183,7 @@ func (s *MmctlE2ETestSuite) TestArchiveCommandCmdF() {
err := archiveCommandCmdF(c, &cobra.Command{}, []string{nonexistentCommandID})
s.Require().NotNil(err)
s.Require().Equal(fmt.Sprintf("Unable to archive command '%s' error: : Sorry, we could not find the page., There doesn't appear to be an api call for the url='/api/v4/commands/nonexistent-command-id'. Typo? are you missing a team_id or user_id as part of the url?", nonexistentCommandID), err.Error())
s.Require().Equal(fmt.Sprintf("Unable to archive command '%s' error: Sorry, we could not find the page., There doesn't appear to be an api call for the url='/api/v4/commands/nonexistent-command-id'. Typo? are you missing a team_id or user_id as part of the url?", nonexistentCommandID), err.Error())
s.Require().Len(printer.GetLines(), 0)
s.Require().Len(printer.GetErrorLines(), 0)
})
@@ -242,7 +242,7 @@ func (s *MmctlE2ETestSuite) TestArchiveCommandCmdF() {
err := archiveCommandCmdF(s.th.Client, &cobra.Command{}, []string{command.Id})
s.Require().NotNil(err)
s.Require().Equal(fmt.Sprintf("Unable to archive command '%s' error: : Unable to get the command.", command.Id), err.Error())
s.Require().Equal(fmt.Sprintf("Unable to archive command '%s' error: Unable to get the command.", command.Id), err.Error())
rcommand, err := s.th.App.GetCommand(command.Id)
s.Require().Nil(err)