Skip to content

Commit 29f3b15

Browse files
committed
Clarify changeAuthState docs
1 parent c197a48 commit 29f3b15

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

API.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,14 @@ Before changing the authentication state, `changeAuthState` checks the
178178
`onAuthStateChanged` listeners will only be triggered if the data is not
179179
deeply equal.
180180

181-
To simulate no user being authenticated, pass `null` for `user`.
182-
This operation is queued until the next `flush`.
181+
`user` should be a `MockUser` object or an object with the same fields
182+
as `MockUser`. To simulate no user being authenticated, pass `null` for
183+
`user`. This operation is queued until the next `flush`.
183184

184185
Example:
185186

186187
```js
187-
ref.changeAuthState(new User(ref, {
188+
ref.changeAuthState(new MockUser(ref, {
188189
uid: 'theUid',
189190
190191
emailVerified: true,

test/unit/docs.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
const User = require('../../src/user');
1+
const MockUser = require('../../src/user');
22

33
describe('API.md', () => {
4-
describe('Auth example for', () => {
4+
describe('Auth example for changeAuthState', () => {
55

66
let ref;
77
beforeEach(() => {
88
const Authentication = require('../../').MockAuthentication;
99
ref = new Authentication();
1010
});
1111

12-
it('changeAuthState works as described', () => {
13-
ref.changeAuthState(new User(ref, {
12+
it('works as described', () => {
13+
ref.changeAuthState(new MockUser(ref, {
1414
uid: 'theUid',
1515
1616
emailVerified: true,

0 commit comments

Comments
 (0)