feat(tests): test coverage is 70.5

This commit is contained in:
misha
2026-01-26 16:38:15 +03:00
parent 92205c09d6
commit 29589ef6fd
49 changed files with 2690 additions and 18 deletions

View File

@@ -78,5 +78,22 @@ void main() {
expect(find.byType(BlockedUsersScreen), findsOneWidget);
expect(find.text('Чёрный список'), findsOneWidget);
});
testWidgets('renders blocked users screen with error state', (tester) async {
final cubit = MockBlockedUsersCubit();
const state = BlockedUsersStateError(errorMessage: 'Error message');
when(cubit.state).thenReturn(state);
when(cubit.stream).thenAnswer((_) => Stream.value(state));
when(cubit.close()).thenAnswer((_) async => Future<void>.value());
when(cubit.getBlockedUsers()).thenAnswer((_) async => Future<void>.value());
sl.registerFactory<BlockedUsersCubit>(() => cubit);
await tester.pumpWidget(wrap(const BlockedUsersScreen()));
await tester.pump();
expect(find.byType(BlockedUsersScreen), findsOneWidget);
});
});
}