[tests][auth] more tests - coverage now > 95%
This commit is contained in:
parent
53bb38c3a4
commit
feec632306
|
@ -3,6 +3,64 @@ describe('auth()', () => {
|
|||
if (firebase.auth().currentUser) await firebase.auth().signOut();
|
||||
});
|
||||
|
||||
describe('applyActionCode()', () => {
|
||||
it('errors on invalid code', async () => {
|
||||
try {
|
||||
await firebase.auth().applyActionCode('fooby shooby dooby');
|
||||
} catch (e) {
|
||||
e.message.should.containEql('code is invalid');
|
||||
}
|
||||
});
|
||||
|
||||
xit('accepts a valid code', async () => {
|
||||
// todo not sure how to generate a code yet - maybe via admin sdk?
|
||||
});
|
||||
});
|
||||
|
||||
describe('checkActionCode()', () => {
|
||||
it('errors on invalid code', async () => {
|
||||
try {
|
||||
await firebase.auth().checkActionCode('fooby shooby dooby');
|
||||
} catch (e) {
|
||||
e.message.should.containEql('code is invalid');
|
||||
}
|
||||
});
|
||||
|
||||
xit('accepts a valid code', async () => {
|
||||
// todo not sure how to generate a code yet - maybe via admin sdk?
|
||||
});
|
||||
});
|
||||
|
||||
describe('verifyPasswordResetCode()', () => {
|
||||
it('errors on invalid code', async () => {
|
||||
try {
|
||||
await firebase.auth().verifyPasswordResetCode('fooby shooby dooby');
|
||||
} catch (e) {
|
||||
e.message.should.containEql('code is invalid');
|
||||
}
|
||||
});
|
||||
|
||||
xit('accepts a valid code', async () => {
|
||||
// todo not sure how to generate a code yet - maybe via admin sdk?
|
||||
});
|
||||
});
|
||||
|
||||
describe('confirmPasswordReset()', () => {
|
||||
it('errors on invalid code', async () => {
|
||||
try {
|
||||
await firebase
|
||||
.auth()
|
||||
.confirmPasswordReset('fooby shooby dooby', 'passwordthing');
|
||||
} catch (e) {
|
||||
e.message.should.containEql('code is invalid');
|
||||
}
|
||||
});
|
||||
|
||||
xit('accepts a valid code', async () => {
|
||||
// todo not sure how to generate a code yet - maybe via admin sdk?
|
||||
});
|
||||
});
|
||||
|
||||
describe('signInWithCustomToken()', () => {
|
||||
it('signs in with a admin sdk created custom auth token', async () => {
|
||||
const customUID = `custom${randomString(12, '#aA')}`;
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
xdescribe('auth() => Phone', () => {
|
||||
// TODO mock native events using bridge's event inspector / mocking tools (still wip)
|
||||
});
|
Loading…
Reference in New Issue