forked from eatvio/eatvio_app
feat(tests): updated tests coverage to 66.5%
This commit is contained in:
29
test/features/create_plan/models/plan_slug_model_test.dart
Normal file
29
test/features/create_plan/models/plan_slug_model_test.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:eatvio_app/features/create_plan/models/plan_slug_model.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('PlanSlugModel', () {
|
||||
test('fromJson parses slug correctly', () {
|
||||
final json = {'slug': 'test-plan-slug'};
|
||||
|
||||
final model = PlanSlugModel.fromJson(json);
|
||||
|
||||
expect(model.slug, 'test-plan-slug');
|
||||
});
|
||||
|
||||
test('toJson serializes slug correctly', () {
|
||||
final model = PlanSlugModel(slug: 'test-plan-slug');
|
||||
|
||||
final json = model.toJson();
|
||||
|
||||
expect(json['slug'], 'test-plan-slug');
|
||||
});
|
||||
|
||||
test('creates instance with slug', () {
|
||||
final model = PlanSlugModel(slug: 'another-slug');
|
||||
|
||||
expect(model.slug, 'another-slug');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user