forked from eatvio/eatvio_app
feat(tests): updated tests coverage to 66.5%
This commit is contained in:
@@ -3,23 +3,26 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('PlanComplainModel', () {
|
||||
test('создает PlanComplainModel с правильными значениями', () {
|
||||
final model = PlanComplainModel(
|
||||
description: 'Test complaint',
|
||||
);
|
||||
|
||||
expect(model.description, 'Test complaint');
|
||||
});
|
||||
|
||||
test('fromJson создает PlanComplainModel из JSON', () {
|
||||
final json = {
|
||||
'description': 'Test complaint',
|
||||
};
|
||||
test('fromJson parses description correctly', () {
|
||||
final json = {'description': 'Test complaint description'};
|
||||
|
||||
final model = PlanComplainModel.fromJson(json);
|
||||
|
||||
expect(model.description, 'Test complaint');
|
||||
expect(model.description, 'Test complaint description');
|
||||
});
|
||||
|
||||
test('toJson serializes description correctly', () {
|
||||
final model = PlanComplainModel(description: 'Test complaint description');
|
||||
|
||||
final json = model.toJson();
|
||||
|
||||
expect(json['description'], 'Test complaint description');
|
||||
});
|
||||
|
||||
test('creates instance with description', () {
|
||||
final model = PlanComplainModel(description: 'Another complaint');
|
||||
|
||||
expect(model.description, 'Another complaint');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user