diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart index 921d7e2..9dcfd68 100644 --- a/integration_test/app_test.dart +++ b/integration_test/app_test.dart @@ -42,6 +42,26 @@ void main() { expect(find.byType(SnackBar), findsOneWidget); }, ); + testWidgets( + 'when the user enters the correct email and password, they are taken to the homescreen and the products are being fetched', + (tester) async { + await tester.pumpWidget(App()); + await tester.pumpAndSettle(); + await tester.enterText( + find.byKey(const Key('username-field')), + 'kminchelle', + ); + await tester.enterText( + find.byKey(const Key('password-field')), + '0lelplR', + ); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('login-button'))); + await tester.pumpAndSettle(); + expect(find.byType(ListView), findsOneWidget); + await tester.pumpAndSettle(); + }, + ); }, ); }