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