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 18, 2024
1 parent 31e5d7c commit 296c4c4
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,5 +308,27 @@ 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 296c4c4

Please sign in to comment.