mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-22 12:41:31 +10:00
Jest mocks: added @reach/router and stub for Firebase auth signOut method
This commit is contained in:
@ -57,7 +57,7 @@ class Auth {
|
||||
user.email,
|
||||
user.isAnonymous,
|
||||
user.uid,
|
||||
async () => {},
|
||||
this.signOut,
|
||||
);
|
||||
|
||||
await delay(Constants.defaultDelayInMilliseconds);
|
||||
@ -68,6 +68,20 @@ class Auth {
|
||||
|
||||
return this._currentUser;
|
||||
}
|
||||
|
||||
async signOut() {
|
||||
if (this._currentUser === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._currentUser = null;
|
||||
|
||||
await delay(Constants.defaultDelayInMilliseconds);
|
||||
|
||||
this.onAuthStateChangedObservers.forEach((observer) =>
|
||||
observer(this._currentUser),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Auth;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const deleteUserFunctionName = 'deleteUser';
|
||||
|
||||
const defaultDelayInMilliseconds = 2000;
|
||||
const defaultDelayInMilliseconds = 100;
|
||||
|
||||
class Functions {
|
||||
static get deleteUserFunctionName() {
|
||||
|
||||
Reference in New Issue
Block a user