Modified Google Sign In provider to disconnect form both firebase and Google on sign out, added the apripriate test

This commit is contained in:
Mariano Uvalle 2019-02-27 00:16:15 -06:00
parent 0eebd668d6
commit ac0aed257d
2 changed files with 4 additions and 1 deletions

View file

@ -39,6 +39,7 @@ class GoogleSignInProvider {
}
Future<void> signOut() async {
await _googleSignIn.disconnect();
await _auth.signOut();
}
}

View file

@ -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());
});
});
}