forked from eatvio/eatvio_app
chore(version): update app version to 1.3.5+85 and improve test coverage reporting in CI
This commit is contained in:
@@ -3,34 +3,45 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('ComplainModel', () {
|
||||
test('создает ComplainModel с дефолтными значениями', () {
|
||||
test('создает экземпляр с дефолтными значениями', () {
|
||||
const model = ComplainModel();
|
||||
|
||||
expect(model.description, isNull);
|
||||
expect(model.tags, isEmpty);
|
||||
expect(model.description, null);
|
||||
expect(model.tags, []);
|
||||
});
|
||||
|
||||
test('создает ComplainModel с описанием и тегами', () {
|
||||
test('создает экземпляр с description и tags', () {
|
||||
const model = ComplainModel(
|
||||
description: 'Test complaint',
|
||||
description: 'Test description',
|
||||
tags: ['tag1', 'tag2'],
|
||||
);
|
||||
|
||||
expect(model.description, 'Test complaint');
|
||||
expect(model.description, 'Test description');
|
||||
expect(model.tags, ['tag1', 'tag2']);
|
||||
});
|
||||
|
||||
test('fromJson создает ComplainModel из JSON', () {
|
||||
test('fromJson создает модель из JSON', () {
|
||||
final json = {
|
||||
'description': 'Test complaint',
|
||||
'description': 'Test description',
|
||||
'tags': ['tag1', 'tag2'],
|
||||
};
|
||||
|
||||
final model = ComplainModel.fromJson(json);
|
||||
|
||||
expect(model.description, 'Test complaint');
|
||||
expect(model.description, 'Test description');
|
||||
expect(model.tags, ['tag1', 'tag2']);
|
||||
});
|
||||
|
||||
test('toJson преобразует модель в JSON', () {
|
||||
const model = ComplainModel(
|
||||
description: 'Test description',
|
||||
tags: ['tag1', 'tag2'],
|
||||
);
|
||||
|
||||
final json = model.toJson();
|
||||
|
||||
expect(json['description'], 'Test description');
|
||||
expect(json['tags'], ['tag1', 'tag2']);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user