Skip to content

Commit

Permalink
add check test
Browse files Browse the repository at this point in the history
  • Loading branch information
KristinBi committed Mar 9, 2022
1 parent c99a357 commit 8c9b5b0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/unit/checks_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'dart:convert';

import 'package:github/src/common/model/checks.dart';
import 'package:test/test.dart';

void main() {
group('Check run', () {
test('CheckRun fromJson', () {
// This is a truncated version of the response
const checkRunJson = '''{
"id": 4,
"head_sha": "ce587453ced02b1526dfb4cb910479d431683101",
"external_id": "",
"details_url": "https://example.com",
"status": "completed",
"conclusion": "neutral",
"started_at": "2018-05-04T01:14:52Z",
"name": "mighty_readme",
"check_suite": {
"id": 5
}
}''';
final checkRun = CheckRun.fromJson(jsonDecode(checkRunJson));

expect(checkRun.id, 4);
expect(checkRun.name, 'mighty_readme');
expect(checkRun.conclusion, CheckRunConclusion.neutral);
});
});
}

0 comments on commit 8c9b5b0

Please sign in to comment.