[tests][auth] misc email auth tests

This commit is contained in:
Salakar 2018-05-13 00:37:47 +01:00
parent d0ae75d531
commit 98fb88a882
5 changed files with 70 additions and 38 deletions

View File

@ -991,7 +991,7 @@ describe('auth()', () => {
new Error(
`A user is currently signed in. ${
firebase.auth().currentUser.uid
}`
}`
)
);
}
@ -1099,9 +1099,7 @@ describe('auth()', () => {
} catch (error) {
// Reject
await firebase.auth().currentUser.delete();
Promise.reject(
new Error('sendPasswordResetEmail() caused an error', error)
);
throw new Error('sendPasswordResetEmail() caused an error', error);
}
});
});

View File

@ -0,0 +1,38 @@
describe('auth() -> emailLink Provider', () => {
describe('sendSignInLinkToEmail', () => {
it('should send email', async () => {
const random = randomString(12, '#aA');
const email = `${random}@${random}.com`;
// const email = 'MANUAL TEST EMAIL HERE';
const actionCodeSettings = {
url: 'http://localhost:1337/authLinkFoo?bar=1234',
handleCodeInApp: true,
iOS: {
bundleId: 'com.testing',
},
android: {
packageName: 'com.testing',
installApp: true,
minimumVersion: '12',
},
};
await firebase.auth().sendSignInLinkToEmail(email, actionCodeSettings);
});
});
// FOR MANUAL TESTING ONLY
xdescribe('signInWithEmailLink', () => {
it('should signIn', async () => {
const email = 'MANUAL TEST EMAIL HERE';
const emailLink = 'MANUAL TEST CODE HERE';
const userCredential = await firebase
.auth()
.signInWithEmailLink(email, emailLink);
userCredential.user.email.should.equal(email);
await await firebase.auth().signOut();
});
});
});

View File

@ -1,4 +1,4 @@
describe.only('auth() -> Providers', () => {
describe('auth() -> Providers', () => {
describe('EmailAuthProvider', () => {
describe('constructor', () => {
it('should throw an unsupported error', () => {

View File

@ -139,27 +139,27 @@ PODS:
- GoogleToolboxForMac/NSString+URLArguments (~> 2.1)
- GTMOAuth2 (~> 1.0)
- GTMSessionFetcher/Core (~> 1.1)
- GoogleToolboxForMac/Core (2.1.4):
- GoogleToolboxForMac/Defines (= 2.1.4)
- GoogleToolboxForMac/DebugUtils (2.1.4):
- GoogleToolboxForMac/Defines (= 2.1.4)
- GoogleToolboxForMac/Defines (2.1.4)
- GoogleToolboxForMac/Logger (2.1.4):
- GoogleToolboxForMac/Defines (= 2.1.4)
- GoogleToolboxForMac/NSData+zlib (2.1.4):
- GoogleToolboxForMac/Defines (= 2.1.4)
- GoogleToolboxForMac/NSDictionary+URLArguments (2.1.4):
- GoogleToolboxForMac/DebugUtils (= 2.1.4)
- GoogleToolboxForMac/Defines (= 2.1.4)
- GoogleToolboxForMac/NSString+URLArguments (= 2.1.4)
- GoogleToolboxForMac/NSString+URLArguments (2.1.4)
- GoogleToolboxForMac/StringEncoding (2.1.4):
- GoogleToolboxForMac/Defines (= 2.1.4)
- GoogleToolboxForMac/URLBuilder (2.1.4):
- GoogleToolboxForMac/Core (= 2.1.4)
- GoogleToolboxForMac/Defines (= 2.1.4)
- GoogleToolboxForMac/NSDictionary+URLArguments (= 2.1.4)
- GoogleToolboxForMac/NSString+URLArguments (= 2.1.4)
- GoogleToolboxForMac/Core (2.1.3):
- GoogleToolboxForMac/Defines (= 2.1.3)
- GoogleToolboxForMac/DebugUtils (2.1.3):
- GoogleToolboxForMac/Defines (= 2.1.3)
- GoogleToolboxForMac/Defines (2.1.3)
- GoogleToolboxForMac/Logger (2.1.3):
- GoogleToolboxForMac/Defines (= 2.1.3)
- GoogleToolboxForMac/NSData+zlib (2.1.3):
- GoogleToolboxForMac/Defines (= 2.1.3)
- GoogleToolboxForMac/NSDictionary+URLArguments (2.1.3):
- GoogleToolboxForMac/DebugUtils (= 2.1.3)
- GoogleToolboxForMac/Defines (= 2.1.3)
- GoogleToolboxForMac/NSString+URLArguments (= 2.1.3)
- GoogleToolboxForMac/NSString+URLArguments (2.1.3)
- GoogleToolboxForMac/StringEncoding (2.1.3):
- GoogleToolboxForMac/Defines (= 2.1.3)
- GoogleToolboxForMac/URLBuilder (2.1.3):
- GoogleToolboxForMac/Core (= 2.1.3)
- GoogleToolboxForMac/Defines (= 2.1.3)
- GoogleToolboxForMac/NSDictionary+URLArguments (= 2.1.3)
- GoogleToolboxForMac/NSString+URLArguments (= 2.1.3)
- gRPC (1.11.0):
- gRPC-RxLibrary (= 1.11.0)
- gRPC/Main (= 1.11.0)
@ -208,7 +208,7 @@ PODS:
- React/Core
- React/fishhook
- React/RCTBlob
- RNFirebase (4.0.7):
- RNFirebase (4.1.0):
- Firebase/Core
- React
- yoga (0.55.3.React)
@ -268,7 +268,7 @@ SPEC CHECKSUMS:
Google-Mobile-Ads-SDK: 7404f68120ae8682afeb5af001fbf4aad731c78e
GoogleAPIClientForREST: f7951c455df271bc6259b3ddb4073d0026475ccf
GoogleSignIn: d9ef55b10f0aa401a5de2747f59b725e4b9732ac
GoogleToolboxForMac: 91c824d21e85b31c2aae9bb011c5027c9b4e738f
GoogleToolboxForMac: 2501e2ad72a52eb3dfe7bd9aee7dad11b858bd20
gRPC: 70703dc9ba31c72341fc7f37745cc1c379edee96
gRPC-Core: 164639cd8ae18ca8b65477fafb2efbaecf4f181a
gRPC-ProtoRPC: bb5fddf3424aa4fad74d76736578a79fe40e244e
@ -278,10 +278,10 @@ SPEC CHECKSUMS:
leveldb-library: 08cba283675b7ed2d99629a4bc5fd052cd2bb6a5
nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
Protobuf: 8a9838fba8dae3389230e1b7f8c104aa32389c03
React: aa2040dbb6f317b95314968021bd2888816e03d5
RNFirebase: 2b25fd2e60269f26bb0a76c71dcc942b35a77df0
yoga: a23273df0088bf7f2bb7e5d7b00044ea57a2a54a
React: 573d89cf10312b17920df6328eaf9ab8059283bf
RNFirebase: 387fb46208f07da221cb3e815aaf680bb8f9e26e
yoga: 9403c2451c1b47d8cee3e4f1b6fd0ececc63839c
PODFILE CHECKSUM: 582ceaad051470812ad9203e13b5ea8ad20c78ac
COCOAPODS: 1.4.0
COCOAPODS: 1.3.1

View File

@ -1029,15 +1029,11 @@
"${PODS_ROOT}/FirebaseInvites/Resources/GPPACLPickerResources.bundle",
"${PODS_ROOT}/GTMOAuth2/Source/Touch/GTMOAuth2ViewTouch.xib",
"${PODS_ROOT}/GoogleSignIn/Resources/GoogleSignIn.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
"$PODS_CONFIGURATION_BUILD_DIR/gRPC/gRPCCertificates.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GINInviteResources.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GPPACLPickerResources.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GTMOAuth2ViewTouch.nib",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleSignIn.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;