diff --git a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart index 1629dd1..4c59ece 100644 --- a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart +++ b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart @@ -244,20 +244,23 @@ class DiaryEditScreen extends StatelessWidget { "Время приема пищи", style: CustomTextStyles.bodyMediumBlack900, ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 10.h), - child: ConstrainedBox( - constraints: BoxConstraints( - maxWidth: MediaQuery.of(context).size.width - 260, - ), - child: GestureDetector( - onTap: () => _selectMealTime(context, state), - child: AbsorbPointer( - child: CustomTextFormField( - hintText: state.mealTimeController - ?.format(context) - .toString(), - autofocus: false, + Expanded( + // Adding Expanded widget + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.h), + child: ConstrainedBox( + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).size.width - 260, + ), + child: GestureDetector( + onTap: () => _selectMealTime(context, state), + child: AbsorbPointer( + child: CustomTextFormField( + hintText: state.mealTimeController + ?.format(context) + .toString(), + autofocus: false, + ), ), ), ), diff --git a/test/auth_test.dart b/test/auth_test.dart index 73cb768..22de3a0 100644 --- a/test/auth_test.dart +++ b/test/auth_test.dart @@ -1,16 +1,44 @@ +import 'package:eatvio_app/core/app_export.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:bloc_test/bloc_test.dart'; import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart'; +import 'package:eatvio_app/presentation/auth/auth_screen/bloc/auth_bloc.dart'; +import 'package:eatvio_app/presentation/auth/auth_screen/models/auth_model.dart'; + +class MockAuthBloc extends MockBloc implements AuthBloc {} void main() { - testWidgets('AuthScreen Smoke Test', (WidgetTester tester) async { - // Создаем и загружаем виджет AuthScreen - await tester.pumpWidget(MaterialApp( - home: Builder( - builder: (context) { - return AuthScreen.builder(context); - }, - ), - )); + group('AuthScreen', () { + testWidgets('renders AuthScreen with initial state', + (WidgetTester tester) async { + final authBloc = AuthBloc(AuthState(authModelObj: AuthModel())); + + await tester.pumpWidget( + MaterialApp( + localizationsDelegates: [ + AppLocalizationDelegate(), + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + supportedLocales: [ + Locale( + 'ru', + '', + ), + ], + home: BlocProvider( + create: (context) => authBloc, + child: Builder( + builder: (context) { + return AuthScreen(); + }, + ), + ), + ), + ); + }); }); }