(t *testing.T)
| 440 | } |
| 441 | |
| 442 | func TestRunItemEdit_Text(t *testing.T) { |
| 443 | defer gock.Off() |
| 444 | // gock.Observe(gock.DumpRequest) |
| 445 | |
| 446 | // edit item |
| 447 | gock.New("https://api.github.com"). |
| 448 | Post("/graphql"). |
| 449 | BodyString(`{"query":"mutation UpdateItemValues.*","variables":{"input":{"projectId":"project_id","itemId":"item_id","fieldId":"field_id","value":{"text":"item text"}}}}`). |
| 450 | Reply(200). |
| 451 | JSON(map[string]any{ |
| 452 | "data": map[string]any{ |
| 453 | "updateProjectV2ItemFieldValue": map[string]any{ |
| 454 | "projectV2Item": map[string]any{ |
| 455 | "ID": "item_id", |
| 456 | "content": map[string]any{ |
| 457 | "body": "body", |
| 458 | "title": "title", |
| 459 | "number": 1, |
| 460 | "repository": map[string]any{ |
| 461 | "nameWithOwner": "my-repo", |
| 462 | }, |
| 463 | }, |
| 464 | }, |
| 465 | }, |
| 466 | }, |
| 467 | }) |
| 468 | |
| 469 | client := queries.NewTestClient() |
| 470 | |
| 471 | ios, _, stdout, _ := iostreams.Test() |
| 472 | config := editItemConfig{ |
| 473 | io: ios, |
| 474 | opts: editItemOpts{ |
| 475 | text: "item text", |
| 476 | itemID: "item_id", |
| 477 | projectID: "project_id", |
| 478 | fieldID: "field_id", |
| 479 | }, |
| 480 | client: client, |
| 481 | } |
| 482 | |
| 483 | err := runEditItem(config) |
| 484 | assert.NoError(t, err) |
| 485 | assert.Equal(t, "", stdout.String()) |
| 486 | } |
| 487 | |
| 488 | func TestRunItemEdit_Number(t *testing.T) { |
| 489 | defer gock.Off() |
nothing calls this directly
no test coverage detected