"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/cmd/pr/view/view_test.go" between
gh-cli-1.10.3.tar.gz and gh-cli-1.11.0.tar.gz

About: GitHub CLI is GitHub’s official command line tool.

view_test.go  (gh-cli-1.10.3):view_test.go  (gh-cli-1.11.0)
skipping to change at line 253 skipping to change at line 253
expectedOutputs: []string{ expectedOutputs: []string{
`title:\tBlueberries are from a fork\n`, `title:\tBlueberries are from a fork\n`,
`state:\tOPEN\n`, `state:\tOPEN\n`,
`author:\tnobody\n`, `author:\tnobody\n`,
`labels:\t\n`, `labels:\t\n`,
`assignees:\t\n`, `assignees:\t\n`,
`projects:\t\n`, `projects:\t\n`,
`milestone:\t\n`, `milestone:\t\n`,
`additions:\t100\n`, `additions:\t100\n`,
`deletions:\t10\n`, `deletions:\t10\n`,
`reviewers:\tDEF \(Commented\), def \(Changes req uested\), ghost \(Approved\), hubot \(Commented\), xyz \(Approved\), 123 \(Reque sted\), Team 1 \(Requested\), abc \(Requested\)\n`, `reviewers:\tDEF \(Commented\), def \(Changes req uested\), ghost \(Approved\), hubot \(Commented\), xyz \(Approved\), 123 \(Reque sted\), abc \(Requested\), my-org\/team-1 \(Requested\)\n`,
`\*\*blueberries taste good\*\*`, `\*\*blueberries taste good\*\*`,
}, },
}, },
"Closed PR": { "Closed PR": {
branch: "master", branch: "master",
args: "12", args: "12",
fixtures: map[string]string{ fixtures: map[string]string{
"PullRequestByNumber": "./fixtures/prViewPreviewC losedState.json", "PullRequestByNumber": "./fixtures/prViewPreviewC losedState.json",
}, },
expectedOutputs: []string{ expectedOutputs: []string{
skipping to change at line 353 skipping to change at line 353
fixtures map[string]string fixtures map[string]string
expectedOutputs []string expectedOutputs []string
}{ }{
"Open PR without metadata": { "Open PR without metadata": {
branch: "master", branch: "master",
args: "12", args: "12",
fixtures: map[string]string{ fixtures: map[string]string{
"PullRequestByNumber": "./fixtures/prViewPreview. json", "PullRequestByNumber": "./fixtures/prViewPreview. json",
}, },
expectedOutputs: []string{ expectedOutputs: []string{
`Blueberries are from a fork`, `Blueberries are from a fork #12`,
`Open.*nobody wants to merge 12 commits into mast er from blueberries.+100.-10`, `Open.*nobody wants to merge 12 commits into mast er from blueberries.+100.-10`,
`blueberries taste good`, `blueberries taste good`,
`View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`, `View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`,
}, },
}, },
"Open PR with metadata by number": { "Open PR with metadata by number": {
branch: "master", branch: "master",
args: "12", args: "12",
fixtures: map[string]string{ fixtures: map[string]string{
"PullRequestByNumber": "./fixtures/prViewPreviewW ithMetadataByNumber.json", "PullRequestByNumber": "./fixtures/prViewPreviewW ithMetadataByNumber.json",
}, },
expectedOutputs: []string{ expectedOutputs: []string{
`Blueberries are from a fork`, `Blueberries are from a fork #12`,
`Open.*nobody wants to merge 12 commits into mast er from blueberries.+100.-10`, `Open.*nobody wants to merge 12 commits into mast er from blueberries.+100.-10`,
`Reviewers:.*1 \(.*Requested.*\)\n`, `Reviewers:.*1 \(.*Requested.*\)\n`,
`Assignees:.*marseilles, monaco\n`, `Assignees:.*marseilles, monaco\n`,
`Labels:.*one, two, three, four, five\n`, `Labels:.*one, two, three, four, five\n`,
`Projects:.*Project 1 \(column A\), Project 2 \(c olumn B\), Project 3 \(column C\), Project 4 \(Awaiting triage\)\n`, `Projects:.*Project 1 \(column A\), Project 2 \(c olumn B\), Project 3 \(column C\), Project 4 \(Awaiting triage\)\n`,
`Milestone:.*uluru\n`, `Milestone:.*uluru\n`,
`blueberries taste good`, `blueberries taste good`,
`View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`, `View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`,
}, },
}, },
"Open PR with reviewers by number": { "Open PR with reviewers by number": {
branch: "master", branch: "master",
args: "12", args: "12",
fixtures: map[string]string{ fixtures: map[string]string{
"PullRequestByNumber": "./fixtures/prViewPrevie wWithReviewersByNumber.json", "PullRequestByNumber": "./fixtures/prViewPrevie wWithReviewersByNumber.json",
"ReviewsForPullRequest": "./fixtures/prViewPrevie wManyReviews.json", "ReviewsForPullRequest": "./fixtures/prViewPrevie wManyReviews.json",
}, },
expectedOutputs: []string{ expectedOutputs: []string{
`Blueberries are from a fork`, `Blueberries are from a fork #12`,
`Reviewers:.*DEF \(.*Commented.*\), def \(.*Chang `Reviewers: DEF \(Commented\), def \(Changes requ
es requested.*\), ghost \(.*Approved.*\), hubot \(Commented\), xyz \(.*Approved. ested\), ghost \(Approved\), hubot \(Commented\), xyz \(Approved\), 123 \(Reques
*\), 123 \(.*Requested.*\), Team 1 \(.*Requested.*\), abc \(.*Requested.*\)\n`, ted\), abc \(Requested\), my-org\/team-1 \(Requested\)`,
`blueberries taste good`, `blueberries taste good`,
`View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`, `View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`,
}, },
}, },
"Closed PR": { "Closed PR": {
branch: "master", branch: "master",
args: "12", args: "12",
fixtures: map[string]string{ fixtures: map[string]string{
"PullRequestByNumber": "./fixtures/prViewPreviewC losedState.json", "PullRequestByNumber": "./fixtures/prViewPreviewC losedState.json",
}, },
expectedOutputs: []string{ expectedOutputs: []string{
`Blueberries are from a fork`, `Blueberries are from a fork #12`,
`Closed.*nobody wants to merge 12 commits into ma ster from blueberries.+100.-10`, `Closed.*nobody wants to merge 12 commits into ma ster from blueberries.+100.-10`,
`blueberries taste good`, `blueberries taste good`,
`View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`, `View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`,
}, },
}, },
"Merged PR": { "Merged PR": {
branch: "master", branch: "master",
args: "12", args: "12",
fixtures: map[string]string{ fixtures: map[string]string{
"PullRequestByNumber": "./fixtures/prViewPreviewM ergedState.json", "PullRequestByNumber": "./fixtures/prViewPreviewM ergedState.json",
}, },
expectedOutputs: []string{ expectedOutputs: []string{
`Blueberries are from a fork`, `Blueberries are from a fork #12`,
`Merged.*nobody wants to merge 12 commits into ma ster from blueberries.+100.-10`, `Merged.*nobody wants to merge 12 commits into ma ster from blueberries.+100.-10`,
`blueberries taste good`, `blueberries taste good`,
`View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`, `View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`,
}, },
}, },
"Draft PR": { "Draft PR": {
branch: "master", branch: "master",
args: "12", args: "12",
fixtures: map[string]string{ fixtures: map[string]string{
"PullRequestByNumber": "./fixtures/prViewPreviewD raftState.json", "PullRequestByNumber": "./fixtures/prViewPreviewD raftState.json",
}, },
expectedOutputs: []string{ expectedOutputs: []string{
`Blueberries are from a fork`, `Blueberries are from a fork #12`,
`Draft.*nobody wants to merge 12 commits into mas ter from blueberries.+100.-10`, `Draft.*nobody wants to merge 12 commits into mas ter from blueberries.+100.-10`,
`blueberries taste good`, `blueberries taste good`,
`View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`, `View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`,
}, },
}, },
} }
for name, tc := range tests { for name, tc := range tests {
t.Run(name, func(t *testing.T) { t.Run(name, func(t *testing.T) {
http := &httpmock.Registry{} http := &httpmock.Registry{}
skipping to change at line 504 skipping to change at line 504
wantsErr bool wantsErr bool
}{ }{
"without comments flag": { "without comments flag": {
branch: "master", branch: "master",
cli: "123", cli: "123",
fixtures: map[string]string{ fixtures: map[string]string{
"PullRequestByNumber": "./fixtures/prViewPrevie wSingleComment.json", "PullRequestByNumber": "./fixtures/prViewPrevie wSingleComment.json",
"ReviewsForPullRequest": "./fixtures/prViewPrevie wReviews.json", "ReviewsForPullRequest": "./fixtures/prViewPrevie wReviews.json",
}, },
expectedOutputs: []string{ expectedOutputs: []string{
`some title`, `some title #12`,
`1 \x{1f615} • 2 \x{1f440} • 3 \x{2764}\x{fe0f}`, `1 \x{1f615} • 2 \x{1f440} • 3 \x{2764}\x{fe0f}`,
`some body`, `some body`,
`———————— Not showing 9 comments ————————`, `———————— Not showing 9 comments ————————`,
`marseilles \(Collaborator\) • Jan 9, 2020 • New est comment`, `marseilles \(Collaborator\) • Jan 9, 2020 • New est comment`,
`4 \x{1f389} • 5 \x{1f604} • 6 \x{1f680}`, `4 \x{1f389} • 5 \x{1f604} • 6 \x{1f680}`,
`Comment 5`, `Comment 5`,
`Use --comments to view the full conversation`, `Use --comments to view the full conversation`,
`View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`, `View this pull request on GitHub: https://github .com/OWNER/REPO/pull/12`,
}, },
}, },
"with comments flag": { "with comments flag": {
branch: "master", branch: "master",
cli: "123 --comments", cli: "123 --comments",
fixtures: map[string]string{ fixtures: map[string]string{
"PullRequestByNumber": "./fixtures/prViewPrevi ewSingleComment.json", "PullRequestByNumber": "./fixtures/prViewPrevi ewSingleComment.json",
"ReviewsForPullRequest": "./fixtures/prViewPrevi ewReviews.json", "ReviewsForPullRequest": "./fixtures/prViewPrevi ewReviews.json",
"CommentsForPullRequest": "./fixtures/prViewPrevi ewFullComments.json", "CommentsForPullRequest": "./fixtures/prViewPrevi ewFullComments.json",
}, },
expectedOutputs: []string{ expectedOutputs: []string{
`some title`, `some title #12`,
`some body`, `some body`,
`monalisa • Jan 1, 2020 • Edited`, `monalisa • Jan 1, 2020 • Edited`,
`1 \x{1f615} • 2 \x{1f440} • 3 \x{2764}\x{fe0f} • 4 \x{1f389} • 5 \x{1f604} • 6 \x{1f680} • 7 \x{1f44e} • 8 \x{1f44d}`, `1 \x{1f615} • 2 \x{1f440} • 3 \x{2764}\x{fe0f} • 4 \x{1f389} • 5 \x{1f604} • 6 \x{1f680} • 7 \x{1f44e} • 8 \x{1f44d}`,
`Comment 1`, `Comment 1`,
`sam commented • Jan 2, 2020`, `sam commented • Jan 2, 2020`,
`1 \x{1f44e} • 1 \x{1f44d}`, `1 \x{1f44e} • 1 \x{1f44d}`,
`Review 1`, `Review 1`,
`View the full review: https://github.com/OWNER/R EPO/pull/12#pullrequestreview-1`, `View the full review: https://github.com/OWNER/R EPO/pull/12#pullrequestreview-1`,
`johnnytest \(Contributor\) • Jan 3, 2020`, `johnnytest \(Contributor\) • Jan 3, 2020`,
`Comment 2`, `Comment 2`,
 End of changes. 9 change blocks. 
12 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)