[tests][auth] add tests for new EmailAuthProvider properties & methods

This commit is contained in:
Salakar 2018-05-12 23:36:57 +01:00
parent 1240e6cd93
commit 3cba1c4e62
1 changed files with 31 additions and 1 deletions

View File

@ -1,4 +1,4 @@
describe('auth() -> Providers', () => {
describe.only('auth() -> Providers', () => {
describe('EmailAuthProvider', () => {
describe('constructor', () => {
it('should throw an unsupported error', () => {
@ -22,6 +22,36 @@ describe('auth() -> Providers', () => {
});
});
describe('credentialWithLink', () => {
it('should return a credential object', () => {
const email = 'email@email.com';
const link = 'link';
const credential = firebase.auth.EmailAuthProvider.credentialWithLink(
email,
link
);
credential.providerId.should.equal('emailLink');
credential.token.should.equal(email);
credential.secret.should.equal(link);
});
});
describe('EMAIL_PASSWORD_SIGN_IN_METHOD', () => {
it('should return password', () => {
firebase.auth.EmailAuthProvider.EMAIL_PASSWORD_SIGN_IN_METHOD.should.equal(
'password'
);
});
});
describe('EMAIL_LINK_SIGN_IN_METHOD', () => {
it('should return emailLink', () => {
firebase.auth.EmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD.should.equal(
'emailLink'
);
});
});
describe('PROVIDER_ID', () => {
it('should return password', () => {
firebase.auth.EmailAuthProvider.PROVIDER_ID.should.equal('password');