Skip to content

Commit

Permalink
test: adds Test if Logout is successful test
Browse files Browse the repository at this point in the history
  • Loading branch information
am-casper committed Mar 12, 2024
1 parent 60fee87 commit 21e965f
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,5 +308,25 @@ Future<void> main() async {
final logoutButton = find.textContaining('LogOut');
await tester.tap(logoutButton);
});

testWidgets('Test if Logout is successful', (tester) async {
final model = AppSettingViewModel();
when(model.logout()).thenAnswer((_) async => true);

await tester.pumpWidget(createChangePassScreenDark());
await tester.pumpAndSettle();

await tester.tap(find.byKey(const Key('Logout')));
await tester.pumpAndSettle();

final logoutButton = find.textContaining('LogOut');
await tester.tap(logoutButton);

verify(navigationService.pop());
verify(navigationService.removeAllAndPush(
'/selectLang',
'/',
),);
});
});
}

0 comments on commit 21e965f

Please sign in to comment.