Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paglias committed May 25, 2018
1 parent 12cb907 commit be05e18
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/api/v3/unit/libs/email.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function getUser () {
emails: [{
value: 'email@facebook',
}],
displayName: 'fb display name',
},
},
profile: {
Expand Down Expand Up @@ -100,7 +99,7 @@ describe('emails', () => {

let data = getUserInfo(user, ['name', 'email', '_id', 'canSend']);

expect(data).to.have.property('name', user.auth.facebook.displayName);
expect(data).to.have.property('name', user.profile.name);
expect(data).to.have.property('email', user.auth.facebook.emails[0].value);
expect(data).to.have.property('_id', user._id);
expect(data).to.have.property('canSend', true);
Expand All @@ -110,13 +109,12 @@ describe('emails', () => {
let attachEmail = requireAgain(pathToEmailLib);
let getUserInfo = attachEmail.getUserInfo;
let user = getUser();
delete user.profile.name;
delete user.auth.local.email;
delete user.auth.facebook;

let data = getUserInfo(user, ['name', 'email', '_id', 'canSend']);

expect(data).to.have.property('name', user.auth.local.username);
expect(data).to.have.property('name', user.profile.name);
expect(data).not.to.have.property('email');
expect(data).to.have.property('_id', user._id);
expect(data).to.have.property('canSend', true);
Expand Down

0 comments on commit be05e18

Please sign in to comment.