mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix unitests on API <20 (#4624)
* Fix unitests on API <20 * Fix tests for API >19. Previous commit breaks them
This commit is contained in:
@@ -282,9 +282,13 @@ export function nativeView_recycling_test(createNew: () => View, createLayout?:
|
||||
layout.addChild(newer);
|
||||
layout.addChild(first);
|
||||
|
||||
if (first.typeName !== "SearchBar" && sdkVersion > 19) {
|
||||
if (first.typeName !== "SearchBar") {
|
||||
// There are way too many differences in native methods for search-bar.
|
||||
// There are too many methods that just throw for newly created views in API lvl 19 and 17
|
||||
// There are too many methods that just throw for newly created views in API lvl 19 and 17
|
||||
if (sdkVersion < 21) {
|
||||
TKUnit.waitUntilReady(() => layout.isLayoutValid);
|
||||
}
|
||||
|
||||
compareUsingReflection(newer, first);
|
||||
}
|
||||
|
||||
@@ -311,7 +315,17 @@ function compareUsingReflection(recycledNativeView: View, newNativeView: View):
|
||||
|| name === 'getId'
|
||||
|| name === 'hasFocus'
|
||||
|| name === 'isDirty'
|
||||
|| name === 'getLeft'
|
||||
|| name === 'getTop'
|
||||
|| name === 'getRight'
|
||||
|| name === 'getBottom'
|
||||
|| name === 'getWidth'
|
||||
|| name === 'getHeight'
|
||||
|| name === 'getX'
|
||||
|| name === 'getY'
|
||||
|| name.includes('getMeasured')
|
||||
|| name === 'toString';
|
||||
|
||||
if (skip || method.getParameterTypes().length > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user