(t *testing.T)
| 765 | } |
| 766 | |
| 767 | func TestPRView_nontty_Comments(t *testing.T) { |
| 768 | tests := map[string]struct { |
| 769 | branch string |
| 770 | cli string |
| 771 | fixtures map[string]string |
| 772 | expectedOutputs []string |
| 773 | wantsErr bool |
| 774 | }{ |
| 775 | "without comments flag": { |
| 776 | branch: "master", |
| 777 | cli: "123", |
| 778 | fixtures: map[string]string{ |
| 779 | "PullRequestByNumber": "./fixtures/prViewPreviewSingleComment.json", |
| 780 | "ReviewsForPullRequest": "./fixtures/prViewPreviewReviews.json", |
| 781 | }, |
| 782 | expectedOutputs: []string{ |
| 783 | `title:\tsome title`, |
| 784 | `state:\tOPEN`, |
| 785 | `author:\tnobody`, |
| 786 | `url:\thttps://github.com/OWNER/REPO/pull/12`, |
| 787 | `some body`, |
| 788 | }, |
| 789 | }, |
| 790 | "with comments flag": { |
| 791 | branch: "master", |
| 792 | cli: "123 --comments", |
| 793 | fixtures: map[string]string{ |
| 794 | "PullRequestByNumber": "./fixtures/prViewPreviewSingleComment.json", |
| 795 | "ReviewsForPullRequest": "./fixtures/prViewPreviewReviews.json", |
| 796 | "CommentsForPullRequest": "./fixtures/prViewPreviewFullComments.json", |
| 797 | }, |
| 798 | expectedOutputs: []string{ |
| 799 | `author:\tmonalisa`, |
| 800 | `association:\tnone`, |
| 801 | `edited:\ttrue`, |
| 802 | `status:\tnone`, |
| 803 | `Comment 1`, |
| 804 | `author:\tsam`, |
| 805 | `association:\tnone`, |
| 806 | `edited:\tfalse`, |
| 807 | `status:\tcommented`, |
| 808 | `Review 1`, |
| 809 | `author:\tjohnnytest`, |
| 810 | `association:\tcontributor`, |
| 811 | `edited:\tfalse`, |
| 812 | `status:\tnone`, |
| 813 | `Comment 2`, |
| 814 | `author:\tmatt`, |
| 815 | `association:\towner`, |
| 816 | `edited:\tfalse`, |
| 817 | `status:\tchanges requested`, |
| 818 | `Review 2`, |
| 819 | `author:\telvisp`, |
| 820 | `association:\tmember`, |
| 821 | `edited:\tfalse`, |
| 822 | `status:\tnone`, |
| 823 | `Comment 3`, |
| 824 | `author:\tleah`, |
nothing calls this directly
no test coverage detected