test: additional test for parsing enum field with @SerializableField(serializer: ..., deserializer: ...)

This commit is contained in:
Ben Vercammen 2023-03-21 22:19:10 +01:00
parent 966622ed2f
commit 0d969aa7f9

View file

@ -0,0 +1,13 @@
import 'package:angel3_orm_test/src/models/has_car.dart';
import 'package:test/test.dart';
void main() async {
/// See https://github.com/dukefirehawk/angel/pull/98
test('enum field with custom deserializer should be parsed consistently', () {
final query = HasCarQuery();
final hasCar = query.parseRow([null, null, null, 'R', null]).value;
expect(hasCar.color, equals(Color.red));
});
}