MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestTeamRemoveMemberErrorIncludesEmailDetails

Function TestTeamRemoveMemberErrorIncludesEmailDetails

cmd/team_json_test.go:339–358  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

337}
338
339func TestTeamRemoveMemberErrorIncludesEmailDetails(t *testing.T) {
340 stubTeamClient(t, &mockTeamClient{
341 membersRemoveFn: func(arg *team.MembersRemoveArg) (*async.LaunchEmptyResult, error) {
342 return nil, errors.New("remove failed")
343 },
344 })
345
346 cmd, stdout := teamTestCmd(t, true)
347 err := removeMember(cmd, []string{"old@example.com"})
348 if err == nil {
349 t.Fatal("expected removeMember error")
350 }
351 details := jsonErrorDetails(err)
352 if details["operation"] != "team_remove_member" || details["email"] != "old@example.com" {
353 t.Fatalf("details = %#v, want team_remove_member operation and email", details)
354 }
355 if got := stdout.String(); got != "" {
356 t.Fatalf("stdout = %q, want no success output", got)
357 }
358}
359
360func TestTeamJSONErrorWritesNoSuccessOutput(t *testing.T) {
361 stubTeamClient(t, &mockTeamClient{

Callers

nothing calls this directly

Calls 4

stubTeamClientFunction · 0.85
teamTestCmdFunction · 0.85
removeMemberFunction · 0.85
jsonErrorDetailsFunction · 0.85

Tested by

no test coverage detected