Skip to content

Commit 6595153

Browse files
committed
use official value
1 parent 8c9b5b0 commit 6595153

File tree

1 file changed

+81
-2
lines changed

1 file changed

+81
-2
lines changed

test/unit/checks_test.dart

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,98 @@ import 'package:test/test.dart';
66
void main() {
77
group('Check run', () {
88
test('CheckRun fromJson', () {
9-
// This is a truncated version of the response
9+
/// The checkRun Json is the official Github values
10+
///
11+
/// Github api url: https://docs.github.com/en/rest/reference/checks#get-a-check-run
1012
const checkRunJson = '''{
1113
"id": 4,
1214
"head_sha": "ce587453ced02b1526dfb4cb910479d431683101",
15+
"node_id": "MDg6Q2hlY2tSdW40",
1316
"external_id": "",
17+
"url": "https://api.github.com/repos/github/hello-world/check-runs/4",
18+
"html_url": "https://github.com/github/hello-world/runs/4",
1419
"details_url": "https://example.com",
1520
"status": "completed",
1621
"conclusion": "neutral",
1722
"started_at": "2018-05-04T01:14:52Z",
23+
"completed_at": "2018-05-04T01:14:52Z",
24+
"output": {
25+
"title": "Mighty Readme report",
26+
"summary": "There are 0 failures, 2 warnings, and 1 notice.",
27+
"text": "You may have some misspelled words on lines 2 and 4. You also may want to add a section in your README about how to install your app.",
28+
"annotations_count": 2,
29+
"annotations_url": "https://api.github.com/repos/github/hello-world/check-runs/4/annotations"
30+
},
1831
"name": "mighty_readme",
1932
"check_suite": {
2033
"id": 5
21-
}
34+
},
35+
"app": {
36+
"id": 1,
37+
"slug": "octoapp",
38+
"node_id": "MDExOkludGVncmF0aW9uMQ==",
39+
"owner": {
40+
"login": "github",
41+
"id": 1,
42+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
43+
"url": "https://api.github.com/orgs/github",
44+
"repos_url": "https://api.github.com/orgs/github/repos",
45+
"events_url": "https://api.github.com/orgs/github/events",
46+
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
47+
"gravatar_id": "",
48+
"html_url": "https://github.com/octocat",
49+
"followers_url": "https://api.github.com/users/octocat/followers",
50+
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
51+
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
52+
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
53+
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
54+
"organizations_url": "https://api.github.com/users/octocat/orgs",
55+
"received_events_url": "https://api.github.com/users/octocat/received_events",
56+
"type": "User",
57+
"site_admin": true
58+
},
59+
"name": "Octocat App",
60+
"description": "",
61+
"external_url": "https://example.com",
62+
"html_url": "https://github.com/apps/octoapp",
63+
"created_at": "2017-07-08T16:18:44-04:00",
64+
"updated_at": "2017-07-08T16:18:44-04:00",
65+
"permissions": {
66+
"metadata": "read",
67+
"contents": "read",
68+
"issues": "write",
69+
"single_file": "write"
70+
},
71+
"events": [
72+
"push",
73+
"pull_request"
74+
]
75+
},
76+
"pull_requests": [
77+
{
78+
"url": "https://api.github.com/repos/github/hello-world/pulls/1",
79+
"id": 1934,
80+
"number": 3956,
81+
"head": {
82+
"ref": "say-hello",
83+
"sha": "3dca65fa3e8d4b3da3f3d056c59aee1c50f41390",
84+
"repo": {
85+
"id": 526,
86+
"url": "https://api.github.com/repos/github/hello-world",
87+
"name": "hello-world"
88+
}
89+
},
90+
"base": {
91+
"ref": "master",
92+
"sha": "e7fdf7640066d71ad16a86fbcbb9c6a10a18af4f",
93+
"repo": {
94+
"id": 526,
95+
"url": "https://api.github.com/repos/github/hello-world",
96+
"name": "hello-world"
97+
}
98+
}
99+
}
100+
]
22101
}''';
23102
final checkRun = CheckRun.fromJson(jsonDecode(checkRunJson));
24103

0 commit comments

Comments
 (0)