Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions pull_request_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package api

import (
"encoding/json"
"testing"
)

func TestPullRequest_ChecksStatus(t *testing.T) {
pr := PullRequest{}
payload := `
{ "commits": { "nodes": [{ "commit": {
"statusCheckRollup": {
"contexts": {
"nodes": [
{ "state": "SUCCESS" },
{ "state": "PENDING" },
{ "state": "FAILURE" },
{ "status": "IN_PROGRESS",
"conclusion": null },
{ "status": "COMPLETED",
"conclusion": "SUCCESS" },
{ "status": "COMPLETED",
"conclusion": "FAILURE" },
{ "status": "COMPLETED",
"conclusion": "ACTION_REQUIRED" },
{ "status": "COMPLETED",
"conclusion": "STALE" }
]
}
}
} }] } }
`
err := json.Unmarshal([]byte(payload), &pr)
eq(t, err, nil)

checks := pr.ChecksStatus()
eq(t, checks.Total, 8)
eq(t, checks.Pending, 3)
eq(t, checks.Failing, 3)
eq(t, checks.Passing, 2)
}
1 change: 1 addition & 0 deletions share_history (2).xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><historical-records><historical-record activity="com.android.gallery3d/com.android.gallery3d.app.GalleryViewActivity" time="1606049575526" weight="1.0" /><historical-record activity="com.android.gallery3d/com.android.gallery3d.app.GalleryViewActivity" time="1606049584879" weight="1.0" /><historical-record activity="com.lge.videoplayer/com.lge.videoplayer.player.MediaView" time="1606050212563" weight="1.0" /></historical-records>