Skip to content

Commit

Permalink
Merge remote-tracking branch 'original/master' into sign-out-clear-mo…
Browse files Browse the repository at this point in the history
…ck-user
  • Loading branch information
michaelowolf committed Sep 2, 2024
2 parents 17ceea3 + c75f25b commit a2fc706
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/src/firebase_auth_mocks_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ class MockFirebaseAuth implements FirebaseAuth {

@override
Future<void> signOut() async {
maybeThrowException(this, Invocation.method(#signOut, [null]));

mockUser = null;
_notifyCredential(null);
}
Expand Down
11 changes: 11 additions & 0 deletions test/firebase_auth_mocks_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,17 @@ void main() {
);
});

test('signOut', () async {
final auth = MockFirebaseAuth();
whenCalling(Invocation.method(#signOut, null))
.on(auth)
.thenThrow(FirebaseAuthException(code: 'bla'));
expect(
() => auth.signOut(),
throwsA(isA<FirebaseAuthException>()),
);
});

test('fetchSignInMethodsForEmail', () async {
final auth = MockFirebaseAuth();
whenCalling(Invocation.method(
Expand Down

0 comments on commit a2fc706

Please sign in to comment.