Delete Account unit tests: added tests related to Google reauthentication

This commit is contained in:
gianantoniopini
2021-05-20 15:57:01 +02:00
parent 7cb469657d
commit 9e63d0b2c7
18 changed files with 363 additions and 56 deletions

View File

@ -1,20 +1,36 @@
const googleAuthProviderId = 'google.com';
const anonymousUser1 = {
displayName: 'Anonymous User 1',
email: 'anonymous1@noemail.com',
isAnonymous: true,
uid: 'anonym123',
providerId: '',
uid: 'anonym1',
};
const anonymousUser2 = {
displayName: 'Anonymous User 2',
email: 'anonymous2@noemail.com',
isAnonymous: true,
uid: 'anonym456',
providerId: '',
uid: 'anonym2',
};
const googleUser3 = {
displayName: 'Google User 3',
email: 'google3@noemail.com',
isAnonymous: false,
providerId: googleAuthProviderId,
uid: 'google3',
};
const defaultDelayInMilliseconds = 100;
class Auth {
static get googleAuthProviderId() {
return googleAuthProviderId;
}
static get anonymousUser1() {
return anonymousUser1;
}
@ -23,6 +39,10 @@ class Auth {
return anonymousUser2;
}
static get googleUser3() {
return googleUser3;
}
static get defaultDelayInMilliseconds() {
return defaultDelayInMilliseconds;
}

View File

@ -9,7 +9,9 @@ const connectedPath = '.info/connected';
const demoStateResume1Id = 'demo_1';
const demoStateResume2Id = 'demo_2';
const initialStateResumeId = 'initst';
const demoStateResume3Id = 'demo_3';
const initialStateResume1Id = 'init_1';
const initialStateResume2Id = 'init_2';
const user1 = {
uid: AuthConstants.anonymousUser1.uid,
@ -19,6 +21,10 @@ const user2 = {
uid: AuthConstants.anonymousUser2.uid,
isAnonymous: AuthConstants.anonymousUser2.isAnonymous,
};
const user3 = {
uid: AuthConstants.googleUser3.uid,
isAnonymous: AuthConstants.googleUser3.isAnonymous,
};
const defaultDelayInMilliseconds = 100;
@ -51,8 +57,16 @@ class Database {
return demoStateResume2Id;
}
static get initialStateResumeId() {
return initialStateResumeId;
static get demoStateResume3Id() {
return demoStateResume3Id;
}
static get initialStateResume1Id() {
return initialStateResume1Id;
}
static get initialStateResume2Id() {
return initialStateResume2Id;
}
static get user1() {
@ -63,6 +77,10 @@ class Database {
return user2;
}
static get user3() {
return user3;
}
static get defaultDelayInMilliseconds() {
return defaultDelayInMilliseconds;
}