[tests][auth] ensure signed out state before each auth test

This commit is contained in:
Salakar
2018-09-16 17:58:01 +01:00
parent fb57495a15
commit c8abdd53d0
4 changed files with 22 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ describe('auth()', () => {
beforeEach(async () => {
if (firebase.auth().currentUser) {
await firebase.auth().signOut();
await sleep(25);
await sleep(50);
}
});

View File

@@ -1,4 +1,11 @@
describe('auth() -> emailLink Provider', () => {
beforeEach(async () => {
if (firebase.auth().currentUser) {
await firebase.auth().signOut();
await sleep(50);
}
});
describe('sendSignInLinkToEmail', () => {
it('should send email', async () => {
const random = randomString(12, '#aA');

View File

@@ -1,4 +1,11 @@
describe('auth() -> Providers', () => {
beforeEach(async () => {
if (firebase.auth().currentUser) {
await firebase.auth().signOut();
await sleep(50);
}
});
describe('EmailAuthProvider', () => {
describe('constructor', () => {
it('should throw an unsupported error', () => {

View File

@@ -1,4 +1,11 @@
describe('auth().currentUser', () => {
beforeEach(async () => {
if (firebase.auth().currentUser) {
await firebase.auth().signOut();
await sleep(50);
}
});
describe('getIdToken()', () => {
it('should return a token', async () => {
const random = randomString(12, '#aA');