Skip to content

Commit

Permalink
test(field): Add test for new type object
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul OGGERO committed Mar 21, 2024
1 parent 55a3baf commit e80ab72
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/models/field_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,20 @@ void main() {
});
expect(field.type, equals(Type.geopoint));
expect(field.isMultivalued, isTrue);

field = Field.fromMap({
"name": "name",
"type": "object",
});
expect(field.type, equals(Type.object));
expect(field.isMultivalued, isFalse);

field = Field.fromMap({
"name": "name",
"type": "object[]",
});
expect(field.type, equals(Type.object));
expect(field.isMultivalued, isTrue);
});
test('sets default values to fields when null', () {
final field = Field.fromMap({"name": "num_employees", "type": "int32"});
Expand Down

0 comments on commit e80ab72

Please sign in to comment.