forked from eatvio/eatvio_app
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@@ -2,6 +2,8 @@ import 'package:eatvio_app/core/app_config.dart';
|
||||
import 'package:eatvio_app/core/app_initializer.dart';
|
||||
import 'package:eatvio_app/core/locator_service.dart';
|
||||
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart';
|
||||
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart';
|
||||
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart';
|
||||
import 'package:eatvio_app/features/chat/presentation/bloc/chats_cubit/chats_cubit.dart';
|
||||
import 'package:eatvio_app/features/chat/presentation/bloc/chats_cubit/chats_state.dart';
|
||||
@@ -20,7 +22,7 @@ import 'package:network_image_mock/network_image_mock.dart';
|
||||
|
||||
import 'bottom_navigation_bar_widget_test.mocks.dart';
|
||||
|
||||
@GenerateNiceMocks([MockSpec<NotificationsCubit>(), MockSpec<ChatsCubit>()])
|
||||
@GenerateNiceMocks([MockSpec<NotificationsCubit>(), MockSpec<ChatsCubit>(), MockSpec<ProfileAvatarCubit>()])
|
||||
void main() {
|
||||
group('BottomNavigationBarWidget smoke', () {
|
||||
setUpAll(() async {
|
||||
@@ -86,6 +88,7 @@ void main() {
|
||||
mockNetworkImagesFor(() async {
|
||||
final notificationsCubit = MockNotificationsCubit();
|
||||
final chatsCubit = MockChatsCubit();
|
||||
final profileAvatarCubit = MockProfileAvatarCubit();
|
||||
|
||||
when(notificationsCubit.state).thenReturn(const NotificationsState());
|
||||
when(notificationsCubit.stream).thenAnswer((_) => const Stream.empty());
|
||||
@@ -93,16 +96,20 @@ void main() {
|
||||
when(chatsCubit.state).thenReturn(ChatsState());
|
||||
when(chatsCubit.stream).thenAnswer((_) => const Stream.empty());
|
||||
when(chatsCubit.close()).thenAnswer((_) async => Future<void>.value());
|
||||
when(profileAvatarCubit.state).thenReturn(const ProfileAvatarState.loaded(profile: mockUserProfile));
|
||||
when(profileAvatarCubit.stream).thenAnswer((_) => const Stream.empty());
|
||||
when(profileAvatarCubit.close()).thenAnswer((_) async => Future<void>.value());
|
||||
|
||||
await tester.pumpWidget(
|
||||
MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider<NotificationsCubit>.value(value: notificationsCubit),
|
||||
BlocProvider<ChatsCubit>.value(value: chatsCubit),
|
||||
BlocProvider<ProfileAvatarCubit>.value(value: profileAvatarCubit),
|
||||
],
|
||||
child: wrap(
|
||||
const Scaffold(
|
||||
body: BottomNavigationBarWidget(profileModel: mockUserProfile, child: Text('Test Content')),
|
||||
body: BottomNavigationBarWidget(child: Text('Test Content')),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -117,6 +124,7 @@ void main() {
|
||||
mockNetworkImagesFor(() async {
|
||||
final notificationsCubit = MockNotificationsCubit();
|
||||
final chatsCubit = MockChatsCubit();
|
||||
final profileAvatarCubit = MockProfileAvatarCubit();
|
||||
|
||||
when(notificationsCubit.state).thenReturn(const NotificationsState());
|
||||
when(notificationsCubit.stream).thenAnswer((_) => const Stream.empty());
|
||||
@@ -124,16 +132,20 @@ void main() {
|
||||
when(chatsCubit.state).thenReturn(ChatsState());
|
||||
when(chatsCubit.stream).thenAnswer((_) => const Stream.empty());
|
||||
when(chatsCubit.close()).thenAnswer((_) async => Future<void>.value());
|
||||
when(profileAvatarCubit.state).thenReturn(const ProfileAvatarState.loaded(profile: mockConsultantProfile));
|
||||
when(profileAvatarCubit.stream).thenAnswer((_) => const Stream.empty());
|
||||
when(profileAvatarCubit.close()).thenAnswer((_) async => Future<void>.value());
|
||||
|
||||
await tester.pumpWidget(
|
||||
MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider<NotificationsCubit>.value(value: notificationsCubit),
|
||||
BlocProvider<ChatsCubit>.value(value: chatsCubit),
|
||||
BlocProvider<ProfileAvatarCubit>.value(value: profileAvatarCubit),
|
||||
],
|
||||
child: wrap(
|
||||
const Scaffold(
|
||||
body: BottomNavigationBarWidget(profileModel: mockConsultantProfile, child: Text('Test Content')),
|
||||
body: BottomNavigationBarWidget(child: Text('Test Content')),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user