45 lines
1.4 KiB
Dart
45 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:prediqo_mobile/core/config/app_config.dart';
|
|
import 'package:prediqo_mobile/core/di/injection.dart';
|
|
import 'package:prediqo_mobile/features/auth/bloc/auth_bloc.dart';
|
|
import 'package:prediqo_mobile/features/auth/presentation/login_screen.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
|
|
import 'support/e2e_fixtures.dart';
|
|
|
|
void main() {
|
|
setUpAll(configureE2eTestEnvironment);
|
|
|
|
tearDown(() async {
|
|
if (sl.isRegistered<AppConfig>()) {
|
|
await sl.reset();
|
|
}
|
|
});
|
|
|
|
testWidgets('Login screen shows Tloto branding', (tester) async {
|
|
await setupE2eDependencies(loggedIn: false);
|
|
final authBloc = sl<AuthBloc>();
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
home: BlocProvider.value(value: authBloc, child: const LoginScreen()),
|
|
),
|
|
);
|
|
await e2ePump(tester);
|
|
expect(find.text('Tloto'), findsOneWidget);
|
|
expect(find.byKey(const Key('login_email')), findsOneWidget);
|
|
});
|
|
|
|
testWidgets('Forgot password link is visible on login', (tester) async {
|
|
await setupE2eDependencies(loggedIn: false);
|
|
final authBloc = sl<AuthBloc>();
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
home: BlocProvider.value(value: authBloc, child: const LoginScreen()),
|
|
),
|
|
);
|
|
await e2ePump(tester);
|
|
expect(find.byKey(const Key('forgot_password_link')), findsOneWidget);
|
|
});
|
|
}
|