(t *testing.T)
| 380 | } |
| 381 | |
| 382 | func TestRunItemEdit_Text(t *testing.T) { |
| 383 | defer gock.Off() |
| 384 | // gock.Observe(gock.DumpRequest) |
| 385 | |
| 386 | // edit item |
| 387 | gock.New("https://api.github.com"). |
| 388 | Post("/graphql"). |
| 389 | BodyString(`{"query":"mutation UpdateItemValues.*","variables":{"input":{"projectId":"project_id","itemId":"item_id","fieldId":"field_id","value":{"text":"item text"}}}}`). |
| 390 | Reply(200). |
| 391 | JSON(map[string]interface{}{ |
| 392 | "data": map[string]interface{}{ |
| 393 | "updateProjectV2ItemFieldValue": map[string]interface{}{ |
| 394 | "projectV2Item": map[string]interface{}{ |
| 395 | "ID": "item_id", |
| 396 | "content": map[string]interface{}{ |
| 397 | "body": "body", |
| 398 | "title": "title", |
| 399 | "number": 1, |
| 400 | "repository": map[string]interface{}{ |
| 401 | "nameWithOwner": "my-repo", |
| 402 | }, |
| 403 | }, |
| 404 | }, |
| 405 | }, |
| 406 | }, |
| 407 | }) |
| 408 | |
| 409 | client := queries.NewTestClient() |
| 410 | |
| 411 | ios, _, stdout, _ := iostreams.Test() |
| 412 | config := editItemConfig{ |
| 413 | io: ios, |
| 414 | opts: editItemOpts{ |
| 415 | text: "item text", |
| 416 | itemID: "item_id", |
| 417 | projectID: "project_id", |
| 418 | fieldID: "field_id", |
| 419 | }, |
| 420 | client: client, |
| 421 | } |
| 422 | |
| 423 | err := runEditItem(config) |
| 424 | assert.NoError(t, err) |
| 425 | assert.Equal(t, "", stdout.String()) |
| 426 | } |
| 427 | |
| 428 | func TestRunItemEdit_Number(t *testing.T) { |
| 429 | defer gock.Off() |
nothing calls this directly
no test coverage detected