X Tutup
Skip to content

Commit fd1da2f

Browse files
committed
Add test for pr status blank slate
1 parent 2c94616 commit fd1da2f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

command/pr_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,34 @@ func TestPRStatus(t *testing.T) {
9595
}
9696
}
9797

98+
func TestPRStatus_blankSlate(t *testing.T) {
99+
initBlankContext("OWNER/REPO", "blueberries")
100+
http := initFakeHTTP()
101+
102+
http.StubResponse(200, bytes.NewBufferString(`
103+
{ "data": {} }
104+
`))
105+
106+
output, err := RunCommand(prStatusCmd, "pr status")
107+
if err != nil {
108+
t.Errorf("error running command `pr status`: %v", err)
109+
}
110+
111+
expected := `Current branch
112+
There is no pull request associated with [blueberries]
113+
114+
Created by you
115+
You have no open pull requests
116+
117+
Requesting a code review from you
118+
You have no pull requests to review
119+
120+
`
121+
if output.String() != expected {
122+
t.Errorf("expected %q, got %q", expected, output.String())
123+
}
124+
}
125+
98126
func TestPRList(t *testing.T) {
99127
initBlankContext("OWNER/REPO", "master")
100128
http := initFakeHTTP()

0 commit comments

Comments
 (0)
X Tutup