Commit 9 of 23:
f39eb8a3f0
fix(ios): scroll native test targets into view in either direction
previous
next
whole branch
Review threads live on the whole diff, not on one commit, so
none are shown here - a thread's line means something in the
branch's final form, and painting it into an intermediate
step would put it on code it is not about.
packages/android/src/index.test.ts modified +2 -1 Changes to packages/android/src/index.test.ts ⋯ 557 lines Show the 557 lines above this hunk @@ -558,7 +558,8 @@ describe('Craft Android builder', () => { 558 558 expect ( nativeActivity ) . toContain ( 'if (!current.contains(message))' ) 559 559 expect ( nativeActivity ) . toContain ( 'joinToString(", ")' ) 560 560 expect ( nativeActivity ) . toContain ( 'screen.controls.putAll(next)' ) 561 - expect ( nativeActivity ) . toContain ( 'if ( layout . getChildAt(index) !== childView )' ) 561 + expect ( nativeActivity ) . toContain ( 'if ( childView . parent !== layout )' ) 562 + expect ( nativeActivity ) . toContain ( 'desired.forEach(layout::bringChildToFront)' ) 562 563 expect ( nativeActivity ) . toContain ( 'val modal = screen.modalVisibility.entries.lastOrNull' ) 563 564 expect ( nativeActivity ) . toContain ( 'val suppressDismiss = !visible && consumeDismissSuppression()' ) 564 565 expect ( nativeActivity ) . toContain ( '(modal.key as? CraftNativeModalView)?.requestClose()' )
packages/ios/scripts/compile-templates.ts modified +4 -0 Changes to packages/ios/scripts/compile-templates.ts ⋯ 258 lines Show the 258 lines above this hunk @@ -259,6 +259,10 @@ try { 259 259 ] ) } , 260 260 { command : 'labelid' , id : 'received-taps' , text : inputSequence . join ( ',' ) } , 261 261 { command : 'selected' , text : 'Four' } , 262 + { command : 'scrollto' , text : 'End of scroll fixture' } , 263 + { command : 'expectid' , text : 'driver-scroll-end' } , 264 + { command : 'scrollto' , text : 'Start of scroll fixture' } , 265 + { command : 'expectid' , text : 'driver-scroll-start' } , 262 266 ] ) 263 267 initSimulatorDriver ( { output : driverOutput , bundleId : 'dev.craft.timedinput.host' , 264 268 bundleIdPrefix : 'dev.craft.timedinput' , projectName : 'TimedInputDriver' , tabs : inputNames , script } )
packages/ios/templates/testing/DriverTests.swift.template modified +5 -1 Changes to packages/ios/templates/testing/DriverTests.swift.template ⋯ 447 lines Show the 447 lines above this hunk @@ -448,7 +448,11 @@ final class DriverTests: XCTestCase { 448 448 var found = element(containing: arg) 449 449 var swipes = 0 450 450 while (found == nil || !(found!.isHittable)) && swipes < 8 { 451 - app. swipeUp() 451 + if let target = found, !target.frame.isEmpty, target.frame.midY < app. frame.midY { 452 + app.swipeDown() 453 + } else { 454 + app.swipeUp() 455 + } 452 456 swipes += 1 453 457 found = element(containing: arg) 454 458 }
scripts/native-renderer-contract.test.ts modified +2 -1 Changes to scripts/native-renderer-contract.test.ts ⋯ 3,002 lines Show the 3,002 lines above this hunk @@ -3003,7 +3003,8 @@ describe('native renderer component contract', () => { 3003 3003 } ) 3004 3004 3005 3005 it ( 'prefers authored keys over compiler ids when reconciling native rows' , ( ) => { 3006 - expect ( ios ) . toContain ( 'let direct = [node["key"], props["key"] , props["testID"] ]' ) 3006 + expect ( ios ) . toContain ( 'let direct = [node["key"], props["key"]]' ) 3007 + expect ( ios ) . toContain ( '[node["id"], props["testID"]]' ) 3007 3008 3008 3009 expect ( ios ) . toContain ( 'return authoredKey(only, props: only["props"] as? [String: Any] ?? [:])' ) 3009 3010 expect ( iosFlatList ) . toContain ( '[node["key"], props["key"], props["testID"], node["id"]]' )