Skip to content

Commit 6469bd9

Browse files
committed
Add a couple of extra auth/user tests
1 parent d8e73dd commit 6469bd9

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

test/unit/auth.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,18 @@ describe('Auth', function () {
931931
.then(updatedUser => expect(updatedUser).to.deep.equal(newUser));
932932
});
933933

934+
it('preserves deep equality of users', () => {
935+
ref.createUser(new User(ref, {
936+
uid: 'kato',
937+
938+
}));
939+
return ref.getUser('kato').then(oldUser => {
940+
ref.updateUser(oldUser)
941+
.then(ref.getUser('kato'))
942+
.then(newUser => expect(expect(oldUser).to.deep.equal(newUser)));
943+
});
944+
});
945+
934946
it('should select by uid', () => {
935947
const uid = 456;
936948
const email = '[email protected]';

test/unit/user.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ describe('User', function() {
9797
u1._auth.autoFlush(false);
9898
expect(u2._auth.flushDelay).to.equal(u1._auth.flushDelay);
9999
});
100+
101+
it('preserves deep equality', () => {
102+
const user = new User(auth, {
103+
customClaims: {
104+
'a': 1,
105+
},
106+
});
107+
clock.tick(1000);
108+
expect(user.clone()).to.deep.equal(user);
109+
});
100110
});
101111

102112
describe('#delete', function() {

0 commit comments

Comments
 (0)