forked from eatvio/eatvio_app
refactor(diary) Auth test localization mock
This commit is contained in:
@@ -244,20 +244,23 @@ class DiaryEditScreen extends StatelessWidget {
|
|||||||
"Время приема пищи",
|
"Время приема пищи",
|
||||||
style: CustomTextStyles.bodyMediumBlack900,
|
style: CustomTextStyles.bodyMediumBlack900,
|
||||||
),
|
),
|
||||||
Padding(
|
Expanded(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.h),
|
// Adding Expanded widget
|
||||||
child: ConstrainedBox(
|
child: Padding(
|
||||||
constraints: BoxConstraints(
|
padding: EdgeInsets.symmetric(horizontal: 10.h),
|
||||||
maxWidth: MediaQuery.of(context).size.width - 260,
|
child: ConstrainedBox(
|
||||||
),
|
constraints: BoxConstraints(
|
||||||
child: GestureDetector(
|
maxWidth: MediaQuery.of(context).size.width - 260,
|
||||||
onTap: () => _selectMealTime(context, state),
|
),
|
||||||
child: AbsorbPointer(
|
child: GestureDetector(
|
||||||
child: CustomTextFormField(
|
onTap: () => _selectMealTime(context, state),
|
||||||
hintText: state.mealTimeController
|
child: AbsorbPointer(
|
||||||
?.format(context)
|
child: CustomTextFormField(
|
||||||
.toString(),
|
hintText: state.mealTimeController
|
||||||
autofocus: false,
|
?.format(context)
|
||||||
|
.toString(),
|
||||||
|
autofocus: false,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,16 +1,44 @@
|
|||||||
|
import 'package:eatvio_app/core/app_export.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.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/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<AuthEvent, AuthState> implements AuthBloc {}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
testWidgets('AuthScreen Smoke Test', (WidgetTester tester) async {
|
group('AuthScreen', () {
|
||||||
// Создаем и загружаем виджет AuthScreen
|
testWidgets('renders AuthScreen with initial state',
|
||||||
await tester.pumpWidget(MaterialApp(
|
(WidgetTester tester) async {
|
||||||
home: Builder(
|
final authBloc = AuthBloc(AuthState(authModelObj: AuthModel()));
|
||||||
builder: (context) {
|
|
||||||
return AuthScreen.builder(context);
|
await tester.pumpWidget(
|
||||||
},
|
MaterialApp(
|
||||||
),
|
localizationsDelegates: [
|
||||||
));
|
AppLocalizationDelegate(),
|
||||||
|
GlobalMaterialLocalizations.delegate,
|
||||||
|
GlobalWidgetsLocalizations.delegate,
|
||||||
|
GlobalCupertinoLocalizations.delegate,
|
||||||
|
],
|
||||||
|
supportedLocales: [
|
||||||
|
Locale(
|
||||||
|
'ru',
|
||||||
|
'',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
home: BlocProvider<AuthBloc>(
|
||||||
|
create: (context) => authBloc,
|
||||||
|
child: Builder(
|
||||||
|
builder: (context) {
|
||||||
|
return AuthScreen();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user