Skip to content

Commit 8c9b5b0

Browse files
committed
add check test
1 parent c99a357 commit 8c9b5b0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/unit/checks_test.dart

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import 'dart:convert';
2+
3+
import 'package:github/src/common/model/checks.dart';
4+
import 'package:test/test.dart';
5+
6+
void main() {
7+
group('Check run', () {
8+
test('CheckRun fromJson', () {
9+
// This is a truncated version of the response
10+
const checkRunJson = '''{
11+
"id": 4,
12+
"head_sha": "ce587453ced02b1526dfb4cb910479d431683101",
13+
"external_id": "",
14+
"details_url": "https://example.com",
15+
"status": "completed",
16+
"conclusion": "neutral",
17+
"started_at": "2018-05-04T01:14:52Z",
18+
"name": "mighty_readme",
19+
"check_suite": {
20+
"id": 5
21+
}
22+
}''';
23+
final checkRun = CheckRun.fromJson(jsonDecode(checkRunJson));
24+
25+
expect(checkRun.id, 4);
26+
expect(checkRun.name, 'mighty_readme');
27+
expect(checkRun.conclusion, CheckRunConclusion.neutral);
28+
});
29+
});
30+
}

0 commit comments

Comments
 (0)