(t *testing.T)
| 876 | } |
| 877 | |
| 878 | func TestIssueView_nontty_Issues2NoFields(t *testing.T) { |
| 879 | ios, _, stdout, stderr := iostreams.Test() |
| 880 | |
| 881 | httpReg := &httpmock.Registry{} |
| 882 | defer httpReg.Verify(t) |
| 883 | |
| 884 | httpReg.Register( |
| 885 | httpmock.GraphQL(`query IssueByNumber\b`), |
| 886 | httpmock.StringResponse(issueResponseNoIssues2Fields()), |
| 887 | ) |
| 888 | mockEmptyV2ProjectItems(t, httpReg) |
| 889 | |
| 890 | opts := ViewOptions{ |
| 891 | IO: ios, |
| 892 | Now: func() time.Time { |
| 893 | t, _ := time.Parse(time.RFC822, "03 Nov 24 15:04 UTC") |
| 894 | return t |
| 895 | }, |
| 896 | HttpClient: func() (*http.Client, error) { |
| 897 | return &http.Client{Transport: httpReg}, nil |
| 898 | }, |
| 899 | BaseRepo: func() (ghrepo.Interface, error) { |
| 900 | return ghrepo.New("OWNER", "REPO"), nil |
| 901 | }, |
| 902 | IssueNumber: 456, |
| 903 | } |
| 904 | |
| 905 | err := viewRun(&opts) |
| 906 | require.NoError(t, err) |
| 907 | |
| 908 | assert.Equal(t, "", stderr.String()) |
| 909 | |
| 910 | out := stdout.String() |
| 911 | |
| 912 | // Issues 2.0 keys appear with empty values to keep line counts stable |
| 913 | // for `head | grep` workflows. |
| 914 | assert.Contains(t, out, "issue-type:\t\n") |
| 915 | assert.Contains(t, out, "parent:\t\n") |
| 916 | assert.Contains(t, out, "sub-issues:\t\n") |
| 917 | assert.Contains(t, out, "sub-issues-completed:\t\n") |
| 918 | assert.Contains(t, out, "blocked-by:\t\n") |
| 919 | assert.Contains(t, out, "blocking:\t\n") |
| 920 | } |
| 921 | |
| 922 | func TestIssueView_json_IssueType(t *testing.T) { |
| 923 | httpReg := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected