forked from eatvio/eatvio_app
feat(tests): updated tests coverage to 66.5%
This commit is contained in:
@@ -72,5 +72,32 @@ void main() {
|
||||
expect(model.tags, isNull);
|
||||
expect(model.title, isNull);
|
||||
});
|
||||
|
||||
test('toJson serializes RecipeModel correctly', () {
|
||||
const model = RecipeModel(
|
||||
ingredients: [],
|
||||
steps: [],
|
||||
tags: ['tag1', 'tag2'],
|
||||
type: 'breakfast',
|
||||
state: 'active',
|
||||
title: 'Test Recipe',
|
||||
description: 'Test Description',
|
||||
videoUrl: 'https://example.com/video.mp4',
|
||||
image: 'https://example.com/image.jpg',
|
||||
totalCookingTime: 30,
|
||||
activeCookTime: 20,
|
||||
servings: 4,
|
||||
energyPerServing: 250,
|
||||
);
|
||||
|
||||
final json = model.toJson();
|
||||
|
||||
expect(json['title'], 'Test Recipe');
|
||||
expect(json['description'], 'Test Description');
|
||||
expect(json['video_url'], 'https://example.com/video.mp4');
|
||||
expect(json['tags'], ['tag1', 'tag2']);
|
||||
expect(json['totalCookingTime'], 30);
|
||||
expect(json['servings'], 4);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user