forked from eatvio/eatvio_app
feat(tests): updated tests coverage to 66.5%
This commit is contained in:
@@ -30,6 +30,22 @@ void main() {
|
||||
expect(ingredient.name, 'Apple');
|
||||
expect(ingredient.productId, 1);
|
||||
});
|
||||
|
||||
test('toJson serializes Ingredient correctly', () {
|
||||
const ingredient = Ingredient(
|
||||
name: 'Apple',
|
||||
unit: 'gr',
|
||||
portion: '100',
|
||||
productId: 1,
|
||||
);
|
||||
|
||||
final json = ingredient.toJson();
|
||||
|
||||
expect(json['name'], 'Apple');
|
||||
expect(json['unit'], 'gr');
|
||||
expect(json['portion'], '100');
|
||||
expect(json['product_nutritional_id'], 1);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user