-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* RN 65 React Native upgrade + babel unit tests running as expected * RN66 - Normal unit tests working - Upgrade to RN66. - Move jest to jest config file. - Use babel-test transformer to make unit tests working - e2e tests that can run as unit wont work. * disable running e2es as units * use Hermes + Fix Reanimated * update reanimated and use babel plugin * Enable coverage * Upgrade jest and babel to 27 * enable JS e2e add animatable to transform ignore * use babel jest as transformer instead of the react native one * update android to 30 * Fix overlay insets and use non deprecated methods * Kotlin convert * tmp status * Update Detox to support iOS 15 * Fix e2e * Revert "tmp status" This reverts commit aff2b87. * prevent ReactRootViews from having ids * status bar utils static fields * Squashed commit of the following: commit 5959638 Author: Ward Abbass <warda@wix.com> Date: Wed Oct 27 13:04:00 2021 +0300 Keyboard demo playground (#7331) Adding a simple demo that can be used to demonstrate Keyboard show/dismiss when showing/dismissing modal when clicking on submit Co-authored-by: Yogev Ben David <yogev132@gmail.com> * wait for stack/modal to be shown to send didAppear this happens since RN 64 * Fix tests * Ensure modal is not already presented * use 0.66.2 Co-authored-by: svbutko <svbutko@hotmail.com> Co-authored-by: Yogev Ben David <yogev132@gmail.com>
- Loading branch information
1 parent
9647520
commit 5136a2e
Showing
23 changed files
with
216 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
const detox = require('detox'); | ||
const config = require('../package.json').detox; | ||
const exec = require('shell-utils').exec; | ||
const adapter = require('detox/runners/jest/adapter'); | ||
require('detox-testing-library-rnn-adapter').extendDetox(); | ||
|
||
jest.setTimeout(300000); | ||
jasmine.getEnv().addReporter(adapter); | ||
|
||
beforeAll(async () => { | ||
await detox.init(config, { launchApp: false }); | ||
}); | ||
|
||
afterAll(async () => { | ||
await adapter.afterAll(); | ||
await detox.cleanup(); | ||
}); | ||
|
||
beforeEach(async () => { | ||
await adapter.beforeEach(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module.exports = { | ||
preset: 'react-native', | ||
transformIgnorePatterns: [ | ||
'node_modules/(?!(@react-native|react-native|react-native-ui-lib|react-native-animatable)/)', | ||
], | ||
transform: { | ||
'\\.[jt]sx?$': 'babel-jest', | ||
}, | ||
roots: [ | ||
'<rootDir>/lib/src/', | ||
'<rootDir>/playground/src/', | ||
'<rootDir>/integration/', | ||
'<rootDir>/scripts/', | ||
'<rootDir>/e2e/', | ||
], | ||
setupFilesAfterEnv: ['./jest-setup.js'], | ||
testPathIgnorePatterns: ['/node_modules/'], | ||
moduleNameMapper: { | ||
'react-native-navigation/Mock': '<rootDir>/lib/src/Mock', | ||
'react-native-navigation': '<rootDir>/lib/src', | ||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': | ||
'<rootDir>/playground/img/layouts@2x.png', | ||
}, | ||
collectCoverageFrom: [ | ||
'lib/src/**/*.ts', | ||
'lib/src/**/*.tsx', | ||
'integration/**/*.js', | ||
'!lib/dist/index.js', | ||
'!lib/dist/Navigation.js', | ||
'!lib/dist/adapters/**/*', | ||
'!lib/dist/interfaces/**/*', | ||
'!lib/dist/**/*.test.*', | ||
'!integration/**/*.test.*', | ||
'!integration/*.test.*', | ||
'!e2e/**/*test.js', | ||
], | ||
resetMocks: true, | ||
resetModules: true, | ||
coverageReporters: ['json', 'lcov', 'text', 'html'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
lib/android/app/src/main/java/com/reactnativenavigation/utils/StatusBarUtils.java
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
lib/android/app/src/main/java/com/reactnativenavigation/utils/StatusBarUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.reactnativenavigation.utils | ||
|
||
import android.content.Context | ||
import android.os.Build | ||
import android.view.Window | ||
import android.view.WindowManager | ||
|
||
object StatusBarUtils { | ||
private const val STATUS_BAR_HEIGHT_M = 24 | ||
private const val STATUS_BAR_HEIGHT_L = 25 | ||
private var statusBarHeight = -1 | ||
@JvmStatic | ||
fun saveStatusBarHeight(height: Int) { | ||
statusBarHeight = height | ||
} | ||
@JvmStatic | ||
fun getStatusBarHeight(context: Context): Int { | ||
if (statusBarHeight > 0) { | ||
return statusBarHeight | ||
} | ||
val resources = context.resources | ||
val resourceId = resources.getIdentifier("status_bar_height", "dimen", "android") | ||
statusBarHeight = if (resourceId > 0) resources.getDimensionPixelSize(resourceId) else UiUtils.dpToPx( | ||
context, | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) STATUS_BAR_HEIGHT_M else STATUS_BAR_HEIGHT_L | ||
) | ||
return statusBarHeight | ||
} | ||
@JvmStatic | ||
fun getStatusBarHeightDp(context: Context): Int { | ||
return UiUtils.pxToDp(context, getStatusBarHeight(context).toFloat()) | ||
.toInt() | ||
} | ||
@JvmStatic | ||
fun isTranslucent(window: Window): Boolean { | ||
val lp = window.attributes | ||
return lp != null && lp.flags and WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS == WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.