forked from eatvio/eatvio_app
feat(tests): updated tests coverage to 66.5%
This commit is contained in:
@@ -54,6 +54,35 @@ void main() {
|
||||
expect(model.slug, 'consultant-1');
|
||||
expect(model.totalScores, 450);
|
||||
});
|
||||
|
||||
test('toJson serializes FeedConsultantModel correctly', () {
|
||||
const model = FeedConsultantModel(
|
||||
slug: 'consultant-1',
|
||||
name: 'Consultant Name',
|
||||
description: 'Test description',
|
||||
ratingPlace: 1,
|
||||
totalScores: 450,
|
||||
photo: 'https://example.com/photo.jpg',
|
||||
badges: [
|
||||
BadgeModel(
|
||||
id: 1,
|
||||
title: 'Badge 1',
|
||||
description: 'Description',
|
||||
image: 'https://example.com/badge1.jpg',
|
||||
type: 'type',
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
final json = model.toJson();
|
||||
|
||||
expect(json['slug'], 'consultant-1');
|
||||
expect(json['name'], 'Consultant Name');
|
||||
expect(json['additional_info'], 'Test description');
|
||||
expect(json['rating_place'], 1);
|
||||
expect(json['total_scores'], 450);
|
||||
expect(json.containsKey('badges'), isTrue);
|
||||
});
|
||||
});
|
||||
|
||||
group('FeedConsultantPaginationModel', () {
|
||||
|
||||
Reference in New Issue
Block a user