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

@@ -60,6 +60,32 @@ void main() {
expect(state.isLoading, isFalse);
expect(state.error, isNull);
});
test('toJson serializes BlogPostState correctly', () {
final state = BlogPostState(
blogPostModel: null,
isLoading: false,
error: null,
);
final json = state.toJson();
expect(json['isLoading'], isFalse);
expect(json['error'], isNull);
expect(json.containsKey('blogPostModel'), isTrue);
});
test('copyWith creates new instance with updated values', () {
final original = BlogPostState();
final updated = original.copyWith(
isLoading: true,
error: 'Test error',
);
expect(updated.isLoading, isTrue);
expect(updated.error, 'Test error');
expect(updated.blogPostModel, original.blogPostModel);
});
});
}