Skip to content

Commit

Permalink
added integration test for successful login
Browse files Browse the repository at this point in the history
  • Loading branch information
Uuttssaavv committed Oct 22, 2022
1 parent 0bb6a47 commit 90a802d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions integration_test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
);
},
);
}

0 comments on commit 90a802d

Please sign in to comment.