(t *testing.T)
| 874 | } |
| 875 | |
| 876 | func TestPRView_nontty_Comments(t *testing.T) { |
| 877 | tests := map[string]struct { |
| 878 | branch string |
| 879 | cli string |
| 880 | fixtures map[string]string |
| 881 | expectedOutputs []string |
| 882 | wantsErr bool |
| 883 | }{ |
| 884 | "without comments flag": { |
| 885 | branch: "master", |
| 886 | cli: "123", |
| 887 | fixtures: map[string]string{ |
| 888 | "PullRequestByNumber": "./fixtures/prViewPreviewSingleComment.json", |
| 889 | "ReviewsForPullRequest": "./fixtures/prViewPreviewReviews.json", |
| 890 | }, |
| 891 | expectedOutputs: []string{ |
| 892 | `title:\tsome title`, |
| 893 | `state:\tOPEN`, |
| 894 | `author:\tnobody`, |
| 895 | `url:\thttps://github.com/OWNER/REPO/pull/12`, |
| 896 | `some body`, |
| 897 | }, |
| 898 | }, |
| 899 | "with comments flag": { |
| 900 | branch: "master", |
| 901 | cli: "123 --comments", |
| 902 | fixtures: map[string]string{ |
| 903 | "PullRequestByNumber": "./fixtures/prViewPreviewSingleComment.json", |
| 904 | "ReviewsForPullRequest": "./fixtures/prViewPreviewReviews.json", |
| 905 | "CommentsForPullRequest": "./fixtures/prViewPreviewFullComments.json", |
| 906 | }, |
| 907 | expectedOutputs: []string{ |
| 908 | `author:\tmonalisa`, |
| 909 | `association:\tnone`, |
| 910 | `edited:\ttrue`, |
| 911 | `status:\tnone`, |
| 912 | `Comment 1`, |
| 913 | `author:\tsam`, |
| 914 | `association:\tnone`, |
| 915 | `edited:\tfalse`, |
| 916 | `status:\tcommented`, |
| 917 | `Review 1`, |
| 918 | `author:\tjohnnytest`, |
| 919 | `association:\tcontributor`, |
| 920 | `edited:\tfalse`, |
| 921 | `status:\tnone`, |
| 922 | `Comment 2`, |
| 923 | `author:\tmatt`, |
| 924 | `association:\towner`, |
| 925 | `edited:\tfalse`, |
| 926 | `status:\tchanges requested`, |
| 927 | `Review 2`, |
| 928 | `author:\telvisp`, |
| 929 | `association:\tmember`, |
| 930 | `edited:\tfalse`, |
| 931 | `status:\tnone`, |
| 932 | `Comment 3`, |
| 933 | `author:\tleah`, |
nothing calls this directly
no test coverage detected