Skip to content

Commit d8e73dd

Browse files
committed
Clean up auth and user tests
Pass a `User` into the setup instead of a plain object. Also, fix one typo in a test name.
1 parent f0db35f commit d8e73dd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

test/unit/auth.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('Auth', function () {
2323
describe('#changeAuthState', function () {
2424

2525
it('sets the auth data', function () {
26-
var user = {};
26+
var user = new User(ref, {});
2727
ref.changeAuthState(user);
2828
ref.flush();
2929
expect(ref.getAuth()).to.equal(user);
@@ -266,18 +266,18 @@ describe('Auth', function () {
266266
var context = {};
267267
ref.onAuth(spy);
268268
ref.onAuth(spy, context);
269-
ref.changeAuthState({
269+
ref.changeAuthState(new User(ref, {
270270
uid: 'kato1'
271-
});
271+
}));
272272
ref.flush();
273273
expect(spy.callCount).to.equal(4);
274274
spy.reset();
275275
// will not match any context
276276
ref.offAuth(spy, {});
277277
ref.offAuth(spy, context);
278-
ref.changeAuthState({
278+
ref.changeAuthState(new User(ref, {
279279
uid: 'kato2'
280-
});
280+
}));
281281
ref.flush();
282282
expect(spy.callCount).to.equal(1);
283283
});
@@ -331,7 +331,7 @@ describe('Auth', function () {
331331
});
332332
});
333333

334-
it('is not be triggered if auth state does not change', function () {
334+
it('is not triggered if auth state does not change', function () {
335335
ref.changeAuthState({
336336
uid: 'kato'
337337
});

test/unit/user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ describe('User', function() {
217217

218218
describe('#getIdToken', function() {
219219
it('should get token', function() {
220-
var user = new User(auth, {});
220+
const user = new User(auth, {});
221221
return expect(user.getIdToken()).to.eventually.not.be.empty;
222222
});
223223

0 commit comments

Comments
 (0)