@@ -105,5 +105,106 @@ void main() {
105105 expect (checkRun.name, 'mighty_readme' );
106106 expect (checkRun.conclusion, CheckRunConclusion .neutral);
107107 });
108+
109+ test ('CheckRun fromJson for skipped conclusion' , () {
110+ /// The checkRun Json is the official Github values
111+ ///
112+ /// Github api url: https://docs.github.com/en/rest/reference/checks#get-a-check-run
113+ const checkRunJson = '''{
114+ "id": 10,
115+ "head_sha": "ce587453ced02b1526dfb4cb910479d431683101",
116+ "node_id": "MDg6Q2hlY2tSdW40",
117+ "external_id": "",
118+ "url": "https://api.github.com/repos/github/hello-world/check-runs/4",
119+ "html_url": "https://github.com/github/hello-world/runs/4",
120+ "details_url": "https://example.com",
121+ "status": "completed",
122+ "conclusion": "skipped",
123+ "started_at": "2018-05-04T01:14:52Z",
124+ "completed_at": "2018-05-04T01:14:52Z",
125+ "output": {
126+ "title": "Mighty Readme report",
127+ "summary": "There are 0 failures, 2 warnings, and 1 notice.",
128+ "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.",
129+ "annotations_count": 2,
130+ "annotations_url": "https://api.github.com/repos/github/hello-world/check-runs/4/annotations"
131+ },
132+ "name": "mighty_readme",
133+ "check_suite": {
134+ "id": 5
135+ },
136+ "app": {
137+ "id": 1,
138+ "slug": "octoapp",
139+ "node_id": "MDExOkludGVncmF0aW9uMQ==",
140+ "owner": {
141+ "login": "github",
142+ "id": 1,
143+ "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
144+ "url": "https://api.github.com/orgs/github",
145+ "repos_url": "https://api.github.com/orgs/github/repos",
146+ "events_url": "https://api.github.com/orgs/github/events",
147+ "avatar_url": "https://github.com/images/error/octocat_happy.gif",
148+ "gravatar_id": "",
149+ "html_url": "https://github.com/octocat",
150+ "followers_url": "https://api.github.com/users/octocat/followers",
151+ "following_url": "https://api.github.com/users/octocat/following{/other_user}",
152+ "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
153+ "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
154+ "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
155+ "organizations_url": "https://api.github.com/users/octocat/orgs",
156+ "received_events_url": "https://api.github.com/users/octocat/received_events",
157+ "type": "User",
158+ "site_admin": true
159+ },
160+ "name": "Octocat App",
161+ "description": "",
162+ "external_url": "https://example.com",
163+ "html_url": "https://github.com/apps/octoapp",
164+ "created_at": "2017-07-08T16:18:44-04:00",
165+ "updated_at": "2017-07-08T16:18:44-04:00",
166+ "permissions": {
167+ "metadata": "read",
168+ "contents": "read",
169+ "issues": "write",
170+ "single_file": "write"
171+ },
172+ "events": [
173+ "push",
174+ "pull_request"
175+ ]
176+ },
177+ "pull_requests": [
178+ {
179+ "url": "https://api.github.com/repos/github/hello-world/pulls/1",
180+ "id": 1934,
181+ "number": 3956,
182+ "head": {
183+ "ref": "say-hello",
184+ "sha": "3dca65fa3e8d4b3da3f3d056c59aee1c50f41390",
185+ "repo": {
186+ "id": 526,
187+ "url": "https://api.github.com/repos/github/hello-world",
188+ "name": "hello-world"
189+ }
190+ },
191+ "base": {
192+ "ref": "master",
193+ "sha": "e7fdf7640066d71ad16a86fbcbb9c6a10a18af4f",
194+ "repo": {
195+ "id": 526,
196+ "url": "https://api.github.com/repos/github/hello-world",
197+ "name": "hello-world"
198+ }
199+ }
200+ }
201+ ]
202+ }''' ;
203+ final checkRun = CheckRun .fromJson (jsonDecode (checkRunJson));
204+
205+ expect (checkRun.id, 10 );
206+ expect (checkRun.name, 'mighty_readme' );
207+ expect (checkRun.conclusion, CheckRunConclusion .skipped);
208+ });
108209 });
109210}
0 commit comments