forked from eatvio/eatvio_app
feat(tests): updated tests coverage to 66.5%
This commit is contained in:
29
test/features/diary/models/get_day_model_test.dart
Normal file
29
test/features/diary/models/get_day_model_test.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:eatvio_app/features/diary/models/get_day_model.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('GetDayModel', () {
|
||||
test('fromJson parses day correctly', () {
|
||||
final json = {'day': '2024-01-15'};
|
||||
|
||||
final model = GetDayModel.fromJson(json);
|
||||
|
||||
expect(model.day, '2024-01-15');
|
||||
});
|
||||
|
||||
test('toJson serializes day correctly', () {
|
||||
final model = GetDayModel(day: '2024-01-15');
|
||||
|
||||
final json = model.toJson();
|
||||
|
||||
expect(json['day'], '2024-01-15');
|
||||
});
|
||||
|
||||
test('creates instance with day', () {
|
||||
final model = GetDayModel(day: '2024-12-31');
|
||||
|
||||
expect(model.day, '2024-12-31');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user