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

@@ -66,5 +66,22 @@ void main() {
expect(find.byType(MyRecipesScreen), findsOneWidget);
expect(find.text('Мои рецепты'), findsOneWidget);
});
testWidgets('renders my recipes screen with error state', (tester) async {
final cubit = MockMyRecipesCubit();
const state = MyRecipesStateError();
when(cubit.state).thenReturn(state);
when(cubit.stream).thenAnswer((_) => Stream.value(state));
when(cubit.close()).thenAnswer((_) async => Future<void>.value());
when(cubit.getMyRecipes()).thenAnswer((_) async => Future<void>.value());
sl.registerFactory<MyRecipesCubit>(() => cubit);
await tester.pumpWidget(wrap(const MyRecipesScreen()));
await tester.pump();
expect(find.byType(MyRecipesScreen), findsOneWidget);
});
});
}