mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-23 13:11:27 +10:00
Delete Account unit tests: added tests related to Google reauthentication
This commit is contained in:
47
__mocks__/gatsby-plugin-firebase/auth/userInfo.js
Normal file
47
__mocks__/gatsby-plugin-firebase/auth/userInfo.js
Normal file
@ -0,0 +1,47 @@
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
class UserInfo {
|
||||
/**
|
||||
* Creates a new user profile information.
|
||||
*
|
||||
* @param {string|null} displayName Display name.
|
||||
* @param {string|null} email Email.
|
||||
* @param {string} providerId Auth provider ID.
|
||||
* @param {string} uid The user's unique ID.
|
||||
*/
|
||||
constructor(displayName, email, providerId, uid) {
|
||||
if (!uid) {
|
||||
throw new Error('uid must be provided.');
|
||||
} else if (typeof uid !== 'string') {
|
||||
throw new Error('uid should be a string.');
|
||||
} else {
|
||||
this._uid = uid;
|
||||
}
|
||||
|
||||
if (typeof providerId !== 'string') {
|
||||
throw new Error('providerId should be a string.');
|
||||
} else {
|
||||
this._providerId = providerId;
|
||||
}
|
||||
|
||||
this._displayName = displayName;
|
||||
this._email = email;
|
||||
}
|
||||
|
||||
get displayName() {
|
||||
return this._displayName;
|
||||
}
|
||||
|
||||
get email() {
|
||||
return this._email;
|
||||
}
|
||||
|
||||
get providerId() {
|
||||
return this._providerId;
|
||||
}
|
||||
|
||||
get uid() {
|
||||
return this._uid;
|
||||
}
|
||||
}
|
||||
|
||||
export default UserInfo;
|
||||
Reference in New Issue
Block a user