Modified Google Sign In provider to disconnect form both firebase and Google on sign out, added the apripriate test
This commit is contained in:
parent
0eebd668d6
commit
ac0aed257d
2 changed files with 4 additions and 1 deletions
|
|
@ -39,6 +39,7 @@ class GoogleSignInProvider {
|
|||
}
|
||||
|
||||
Future<void> signOut() async {
|
||||
await _googleSignIn.disconnect();
|
||||
await _auth.signOut();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,11 +38,13 @@ main() {
|
|||
|
||||
test('should sign out a user', () {
|
||||
final auth = MockFirebaseAuth();
|
||||
final provider = GoogleSignInProvider(null, auth);
|
||||
final googleSignIn = MockGoogleSignIn();
|
||||
final provider = GoogleSignInProvider(googleSignIn, auth);
|
||||
|
||||
when(auth.signOut()).thenAnswer((_) => Future.value());
|
||||
|
||||
expect(provider.signOut(), completes);
|
||||
verify(googleSignIn.disconnect());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue