Skip to content

Commit 42333bb

Browse files
committed
Update issue non-tty view formatting and its tests
1 parent 979ec92 commit 42333bb

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/cmd/issue/view/view.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ func printRawIssuePreview(out io.Writer, issue *api.Issue) error {
160160
milestoneTitle = issue.Milestone.Title
161161
}
162162
fmt.Fprintf(out, "milestone:\t%s\n", milestoneTitle)
163+
fmt.Fprintf(out, "number:\t%d\n", issue.Number)
163164
fmt.Fprintln(out, "--")
164165
fmt.Fprintln(out, issue.Body)
165166
return nil

pkg/cmd/issue/view/view_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ func TestIssueView_nontty_Preview(t *testing.T) {
112112
`comments:\t9`,
113113
`author:\tmarseilles`,
114114
`assignees:`,
115+
`number:\t123\n`,
115116
`\*\*bold story\*\*`,
116117
},
117118
},
@@ -126,6 +127,7 @@ func TestIssueView_nontty_Preview(t *testing.T) {
126127
`labels:\tone, two, three, four, five`,
127128
`projects:\tProject 1 \(column A\), Project 2 \(column B\), Project 3 \(column C\), Project 4 \(Awaiting triage\)\n`,
128129
`milestone:\tuluru\n`,
130+
`number:\t123\n`,
129131
`\*\*bold story\*\*`,
130132
},
131133
},
@@ -136,6 +138,7 @@ func TestIssueView_nontty_Preview(t *testing.T) {
136138
`state:\tOPEN`,
137139
`author:\tmarseilles`,
138140
`labels:\ttarot`,
141+
`number:\t123\n`,
139142
},
140143
},
141144
"Closed issue": {
@@ -146,6 +149,7 @@ func TestIssueView_nontty_Preview(t *testing.T) {
146149
`\*\*bold story\*\*`,
147150
`author:\tmarseilles`,
148151
`labels:\ttarot`,
152+
`number:\t123\n`,
149153
`\*\*bold story\*\*`,
150154
},
151155
},
@@ -386,6 +390,7 @@ func TestIssueView_nontty_Comments(t *testing.T) {
386390
`state:\tOPEN`,
387391
`author:\tmarseilles`,
388392
`comments:\t6`,
393+
`number:\t123`,
389394
`some body`,
390395
},
391396
},

0 commit comments

Comments
 (0)