From 187c756550cf0216a5a3e5170fa9a3f0f50c5ef3 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 13 May 2018 01:00:30 +0100 Subject: [PATCH] [tests][auth] isSignInWithEmailLink tests --- bridge/e2e/auth/emailLink.e2e.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bridge/e2e/auth/emailLink.e2e.js b/bridge/e2e/auth/emailLink.e2e.js index acb9ae25..7b4980b3 100644 --- a/bridge/e2e/auth/emailLink.e2e.js +++ b/bridge/e2e/auth/emailLink.e2e.js @@ -20,6 +20,23 @@ describe('auth() -> emailLink Provider', () => { }); }); + describe('isSignInWithEmailLink', () => { + it('should return true/false', async () => { + const emailLink1 = + 'https://www.example.com/action?mode=signIn&oobCode=oobCode'; + const emailLink2 = + 'https://www.example.com/action?mode=verifyEmail&oobCode=oobCode'; + const emailLink3 = 'https://www.example.com/action?mode=signIn'; + const emailLink4 = + 'https://x59dg.app.goo.gl/?link=https://rnfirebase-b9ad4.firebaseapp.com/__/auth/action?apiKey%3Dfoo%26mode%3DsignIn%26oobCode%3Dbar'; + + should.equal(true, firebase.auth().isSignInWithEmailLink(emailLink1)); + should.equal(false, firebase.auth().isSignInWithEmailLink(emailLink2)); + should.equal(false, firebase.auth().isSignInWithEmailLink(emailLink3)); + should.equal(true, firebase.auth().isSignInWithEmailLink(emailLink4)); + }); + }); + // FOR MANUAL TESTING ONLY xdescribe('signInWithEmailLink', () => { it('should signIn', async () => {