Skip to content

Commit 1171bac

Browse files
committed
Add Integrations Test
1 parent 0e406a7 commit 1171bac

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

integrations/issue_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,32 @@ func TestIssueCommentClose(t *testing.T) {
194194
assert.Equal(t, "Description", val)
195195
}
196196

197+
func TestIssueReaction(t *testing.T) {
198+
defer prepareTestEnv(t)()
199+
session := loginUser(t, "user2")
200+
issueURL := testNewIssue(t, session, "user2", "repo1", "Title", "Description")
201+
202+
req := NewRequest(t, "GET", issueURL)
203+
resp := session.MakeRequest(t, req, http.StatusOK)
204+
htmlDoc := NewHTMLParser(t, resp.Body)
205+
206+
req = NewRequestWithValues(t, "POST", path.Join(issueURL, "/reactions/react"), map[string]string{
207+
"_csrf": htmlDoc.GetCSRF(),
208+
"content": "8ball",
209+
})
210+
session.MakeRequest(t, req, http.StatusInternalServerError)
211+
req = NewRequestWithValues(t, "POST", path.Join(issueURL, "/reactions/react"), map[string]string{
212+
"_csrf": htmlDoc.GetCSRF(),
213+
"content": "eyes",
214+
})
215+
session.MakeRequest(t, req, http.StatusOK)
216+
req = NewRequestWithValues(t, "POST", path.Join(issueURL, "/reactions/unreact"), map[string]string{
217+
"_csrf": htmlDoc.GetCSRF(),
218+
"content": "eyes",
219+
})
220+
session.MakeRequest(t, req, http.StatusOK)
221+
}
222+
197223
func TestIssueCrossReference(t *testing.T) {
198224
defer prepareTestEnv(t)()
199225

0 commit comments

Comments
 (0)