Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/master' into rsgowman/link_by_fe…
…derated_id
  • Loading branch information
rsgowman committed Feb 4, 2021
commit ba5361f59357ed721a4c12535781cc2f5dff97e9
31 changes: 21 additions & 10 deletions test/integration/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,27 @@ describe('admin.auth', () => {

it('updates the user record with the given parameters', () => {
const updatedDisplayName = 'Updated User ' + updateUser.uid;
return admin.auth().updateUser(updateUser.uid, {
email: updatedEmail,
phoneNumber: updatedPhone,
emailVerified: true,
displayName: updatedDisplayName,
})
.then((userRecord) => {
expect(userRecord.emailVerified).to.be.true;
expect(userRecord.displayName).to.equal(updatedDisplayName);
// Confirm expected email.
expect(userRecord.email).to.equal(updatedEmail);
// Confirm expected phone number.
expect(userRecord.phoneNumber).to.equal(updatedPhone);
});
});

it('creates, updates, and removes second factors', function () {
if (authEmulatorHost) {
return this.skip(); // Not yet supported in Auth Emulator.
}

const now = new Date(1476235905000).toUTCString();
// Update user with enrolled second factors.
const enrolledFactors = [
Expand All @@ -579,21 +600,11 @@ describe('admin.auth', () => {
},
];
return admin.auth().updateUser(updateUser.uid, {
email: updatedEmail,
phoneNumber: updatedPhone,
emailVerified: true,
displayName: updatedDisplayName,
multiFactor: {
enrolledFactors,
},
})
.then((userRecord) => {
expect(userRecord.emailVerified).to.be.true;
expect(userRecord.displayName).to.equal(updatedDisplayName);
// Confirm expected email.
expect(userRecord.email).to.equal(updatedEmail);
// Confirm expected phone number.
expect(userRecord.phoneNumber).to.equal(updatedPhone);
// Confirm second factors added to user.
const actualUserRecord: {[key: string]: any} = userRecord.toJSON();
expect(actualUserRecord.multiFactor.enrolledFactors.length).to.equal(2);
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.