feat(tests): updated tests coverage to 66.5%

This commit is contained in:
misha
2026-01-14 18:47:11 +03:00
parent 497ff19cfa
commit 13ccf56df0
102 changed files with 10146 additions and 379 deletions

View File

@@ -57,6 +57,35 @@ void main() {
expect(model.name, 'User Name');
expect(model.profilePhotoUrl, isNull);
});
test('toJson serializes ChatUserModel correctly', () {
const model = ChatUserModel(
id: 1,
name: 'User Name',
slug: 'user-slug',
profilePhotoUrl: 'https://example.com/photo.jpg',
);
final json = model.toJson();
expect(json['id'], 1);
expect(json['name'], 'User Name');
expect(json['slug'], 'user-slug');
expect(json['profile_photo_url'], 'https://example.com/photo.jpg');
});
test('toJson handles null profilePhotoUrl', () {
const model = ChatUserModel(
id: 1,
name: 'User Name',
slug: 'user-slug',
profilePhotoUrl: null,
);
final json = model.toJson();
expect(json['profile_photo_url'], isNull);
});
});
}