From 25b23a11642f370125dd0783556db7d16271dc90 Mon Sep 17 00:00:00 2001 From: Salakar Date: Fri, 13 Apr 2018 15:08:09 +0100 Subject: [PATCH] [tests] misc + auth tweaks --- bridge/app.js | 2 +- bridge/e2e/auth/auth.e2e.js | 34 +++++++------------- bridge/ios/Podfile.lock | 14 ++++---- bridge/ios/testing.xcodeproj/project.pbxproj | 2 +- bridge/package.json | 2 +- 5 files changed, 22 insertions(+), 32 deletions(-) diff --git a/bridge/app.js b/bridge/app.js index 02a4c514..b23af22e 100755 --- a/bridge/app.js +++ b/bridge/app.js @@ -15,7 +15,7 @@ class Root extends Component { this.state = { message: '', }; - + firebase.firestore.enableLogging(); bridge.setBridgeProperty('module', firebase); } diff --git a/bridge/e2e/auth/auth.e2e.js b/bridge/e2e/auth/auth.e2e.js index ac82680f..cb42656d 100644 --- a/bridge/e2e/auth/auth.e2e.js +++ b/bridge/e2e/auth/auth.e2e.js @@ -1,6 +1,9 @@ describe('auth()', () => { beforeEach(async () => { - if (firebase.auth().currentUser) await firebase.auth().signOut(); + if (firebase.auth().currentUser) { + await firebase.auth().signOut(); + await sleep(25); + } }); describe('applyActionCode()', () => { @@ -83,6 +86,8 @@ describe('auth()', () => { it('calls callback with the current user and when auth state changes', async () => { await firebase.auth().signInAnonymouslyAndRetrieveData(); + await sleep(50); + // Test const callback = sinon.spy(); @@ -101,9 +106,7 @@ describe('auth()', () => { await firebase.auth().signOut(); - await new Promise(resolve => { - setTimeout(() => resolve(), 5); - }); + await sleep(50); // Assertions @@ -136,9 +139,7 @@ describe('auth()', () => { await firebase.auth().signOut(); - await new Promise(resolve => { - setTimeout(() => resolve(), 5); - }); + await sleep(50); // Assertions @@ -184,10 +185,7 @@ describe('auth()', () => { // Sign out await firebase.auth().signOut(); - - await new Promise(resolve => { - setTimeout(() => resolve(), 5); - }); + await sleep(50); // Assertions @@ -219,10 +217,7 @@ describe('auth()', () => { // Sign out await firebase.auth().signOut(); - - await new Promise(resolve => { - setTimeout(() => resolve(), 5); - }); + await sleep(50); // Assertions @@ -269,9 +264,7 @@ describe('auth()', () => { await firebase.auth().signOut(); - await new Promise(resolve => { - setTimeout(() => resolve(), 5); - }); + await sleep(50); // Assertions @@ -306,10 +299,7 @@ describe('auth()', () => { // Sign out await firebase.auth().signOut(); - - await new Promise(resolve => { - setTimeout(() => resolve(), 5); - }); + await sleep(50); // Assertions diff --git a/bridge/ios/Podfile.lock b/bridge/ios/Podfile.lock index 66518150..ae86816b 100644 --- a/bridge/ios/Podfile.lock +++ b/bridge/ios/Podfile.lock @@ -206,7 +206,7 @@ PODS: - React/Core - React/fishhook - React/RCTBlob - - RNFirebase (4.0.1): + - RNFirebase (4.0.2): - React - yoga (0.52.3.React) @@ -235,11 +235,11 @@ DEPENDENCIES: EXTERNAL SOURCES: React: - :path: "../node_modules/react-native" + :path: ../node_modules/react-native RNFirebase: - :path: "../../ios/RNFirebase.podspec" + :path: ../../ios/RNFirebase.podspec yoga: - :path: "../node_modules/react-native/ReactCommon/yoga" + :path: ../node_modules/react-native/ReactCommon/yoga SPEC CHECKSUMS: BoringSSL: 32764dbaf5f5888cf51fbaa172a010126b41bcd4 @@ -271,13 +271,13 @@ SPEC CHECKSUMS: gRPC-RxLibrary: a41a4652d220f230ba1c0491a94ce2ee04c6180a GTMOAuth2: c77fe325e4acd453837e72d91e3b5f13116857b2 GTMSessionFetcher: 390ea358e5a0d0133153806f744662dad933d06b - leveldb-library: '08cba283675b7ed2d99629a4bc5fd052cd2bb6a5' + leveldb-library: 08cba283675b7ed2d99629a4bc5fd052cd2bb6a5 nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3 Protobuf: 8a9838fba8dae3389230e1b7f8c104aa32389c03 React: c0dfd2dfc970019d1ae7d48bf24cef530992e079 - RNFirebase: 973ad43718b555e793fdcbbac9c09756150f7024 + RNFirebase: 26c3a2665b893f3ef61a3f0e5fc3f7662fb5d306 yoga: f45a46b966e1eb0c7a532cfd4beec5b97332ba48 PODFILE CHECKSUM: ef0a6d57e421403d349fe645afe7593f62efb9e0 -COCOAPODS: 1.2.1 +COCOAPODS: 1.3.1 diff --git a/bridge/ios/testing.xcodeproj/project.pbxproj b/bridge/ios/testing.xcodeproj/project.pbxproj index 70ce3cf9..344035b6 100755 --- a/bridge/ios/testing.xcodeproj/project.pbxproj +++ b/bridge/ios/testing.xcodeproj/project.pbxproj @@ -1015,7 +1015,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; CC8D61273332DE7812CFF010 /* [CP] Copy Pods Resources */ = { diff --git a/bridge/package.json b/bridge/package.json index 6348173e..cad6460d 100755 --- a/bridge/package.json +++ b/bridge/package.json @@ -14,7 +14,7 @@ "test-android-cover": "nyc detox test --configuration android.emu.debug", "test-android-cover-reuse": "nyc detox test --configuration android.emu.debug --reuse", "test-ios": "detox test --configuration ios.sim.debug", - "test-ios-reuse": "detox test --configuration ios.sim.debug --reuse --loglevel warn", + "test-ios-reuse": "detox test --configuration ios.sim.debug --reuse --loglevel verbose", "test-ios-cover": "nyc detox test --configuration ios.sim.debug", "test-ios-cover-reuse": "nyc detox test --configuration ios.sim.debug --reuse --loglevel warn", "ios:pod:install": "cd ios && rm -rf ReactNativeFirebaseDemo.xcworkspace && pod install && cd .."