forked from eatvio/eatvio_app
45 lines
1.4 KiB
Dart
45 lines
1.4 KiB
Dart
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<AuthEvent, AuthState> implements AuthBloc {}
|
|
|
|
void main() {
|
|
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<AuthBloc>(
|
|
create: (context) => authBloc,
|
|
child: Builder(
|
|
builder: (context) {
|
|
return AuthScreen();
|
|
},
|
|
),
|
|
),
|
|
),
|
|
);
|
|
});
|
|
});
|
|
}
|