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

Function TestTeamInfoJSONOutputsTeamInfo

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

Source from the content-addressed store, hash-verified

118}
119
120func TestTeamInfoJSONOutputsTeamInfo(t *testing.T) {
121 stubTeamClient(t, &mockTeamClient{
122 getInfoFn: func() (*team.TeamGetInfoResult, error) {
123 return &team.TeamGetInfoResult{
124 Name: "Example Team",
125 TeamId: "tid:team",
126 NumLicensedUsers: 10,
127 NumProvisionedUsers: 7,
128 }, nil
129 },
130 })
131
132 cmd, stdout := teamTestCmd(t, true)
133 if err := info(cmd, nil); err != nil {
134 t.Fatalf("info error: %v", err)
135 }
136
137 got := decodeTeamOperationOutput[map[string]any, teamInfoJSON](t, stdout.Bytes())
138 if len(got.Input) != 0 {
139 t.Fatalf("input = %#v, want empty object", got.Input)
140 }
141 result := onlyTeamResult(t, got)
142 if result.Status != teamJSONStatusFound || result.Kind != teamJSONKindTeam {
143 t.Fatalf("operation result = %#v, want found team", result)
144 }
145 if result.Result.Name != "Example Team" || result.Result.TeamID != "tid:team" || result.Result.NumLicensedUsers != 10 || result.Result.NumProvisionedUsers != 7 {
146 t.Fatalf("result = %#v, want team info", result.Result)
147 }
148}
149
150func TestTeamInfoTextUsesCommandOutput(t *testing.T) {
151 stubTeamClient(t, &mockTeamClient{

Callers

nothing calls this directly

Calls 5

stubTeamClientFunction · 0.85
teamTestCmdFunction · 0.85
infoFunction · 0.85
onlyTeamResultFunction · 0.85

Tested by

no test coverage detected