updated modifyTeamsCmdF to return error instead of nil when encounting error (#26606)

Этот коммит содержится в:
Ezekiel
2024-04-10 13:32:41 +08:00
коммит произвёл GitHub
родитель 65c6717e6b
Коммит db2cfe953b
3 изменённых файлов: 31 добавлений и 14 удалений

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

@@ -182,10 +182,12 @@ func (s *MmctlE2ETestSuite) TestModifyTeamsCmdF() {
cmd := &cobra.Command{}
cmd.Flags().Bool("private", true, "")
err := modifyTeamsCmdF(s.th.Client, cmd, []string{teamID})
s.Require().NoError(err)
expectedError := fmt.Sprintf("Unable to modify team '%s' error: You do not have the appropriate permissions.", s.th.BasicTeam.Name)
s.Require().ErrorContains(err, expectedError)
s.Require().Contains(
printer.GetErrorLines()[0],
fmt.Sprintf("Unable to modify team '%s' error: You do not have the appropriate permissions.", s.th.BasicTeam.Name),
expectedError,
)
t, appErr := s.th.App.GetTeam(teamID)
s.Require().Nil(appErr)
@@ -199,10 +201,12 @@ func (s *MmctlE2ETestSuite) TestModifyTeamsCmdF() {
cmd.Flags().Bool("private", true, "")
s.th.LoginBasic2()
err := modifyTeamsCmdF(s.th.Client, cmd, []string{teamID})
s.Require().NoError(err)
expectedError := fmt.Sprintf("Unable to modify team '%s' error: You do not have the appropriate permissions.", s.th.BasicTeam.Name)
s.Require().ErrorContains(err, expectedError)
s.Require().Contains(
printer.GetErrorLines()[0],
fmt.Sprintf("Unable to modify team '%s' error: You do not have the appropriate permissions.", s.th.BasicTeam.Name),
expectedError,
)
t, appErr := s.th.App.GetTeam(teamID)
s.Require().Nil(appErr)