feat(tests): updated tests coverage to 66.5%

This commit is contained in:
misha
2026-01-14 18:47:11 +03:00
parent 497ff19cfa
commit 13ccf56df0
102 changed files with 10146 additions and 379 deletions

View File

@@ -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);
});
});
}