Skip to content

Commit

Permalink
Add test for base fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangomz committed Jun 22, 2021
1 parent 3d71bdc commit bc28557
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/general_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:notion_api/notion/general/base_fields.dart';
import 'package:notion_api/notion/general/types/notion_types.dart';
import 'package:test/test.dart';

void main() {
group('Base fields tests =>', () {
test('Create an instance from json', () {
BaseFields base = BaseFields.fromJson({
"object": "database",
"id": "386da3c6-46bb-4581-8807-1fdb2fbbf447",
"created_time": "2021-05-19T20:21:11.420Z",
"last_edited_time": "2021-06-07T23:02:00.000Z",
"title": [],
});

expect(base.object, ObjectTypes.Database);
expect(base.id, "386da3c6-46bb-4581-8807-1fdb2fbbf447");
expect(base.createdTime, "2021-05-19T20:21:11.420Z");
expect(base.lastEditedTime, "2021-06-07T23:02:00.000Z");
});
});
}

0 comments on commit bc28557

Please sign in to comment.