forked from eatvio/eatvio_app
feat(tests): updated tests coverage to 66.5%
This commit is contained in:
@@ -32,6 +32,24 @@ void main() {
|
||||
expect(model.id, 1);
|
||||
expect(model.title, 'Test Badge');
|
||||
});
|
||||
|
||||
test('toJson serializes BadgeModel correctly', () {
|
||||
const model = BadgeModel(
|
||||
id: 1,
|
||||
title: 'Test Badge',
|
||||
description: 'Test description',
|
||||
image: 'https://example.com/badge.jpg',
|
||||
type: 'achievement',
|
||||
);
|
||||
|
||||
final json = model.toJson();
|
||||
|
||||
expect(json['id'], 1);
|
||||
expect(json['title'], 'Test Badge');
|
||||
expect(json['description'], 'Test description');
|
||||
expect(json['image'], 'https://example.com/badge.jpg');
|
||||
expect(json['type'], 'achievement');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user