Commit 14 of 23:
490ce8d5f8
test(ios): reproduce unrelated screen clearing active tab accessory
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/ios/fixtures/native-navigation/NativeNavigationUnitTests.swift modified +19 -0 Changes to packages/ios/fixtures/native-navigation/NativeNavigationUnitTests.swift ⋯ 418 lines Show the 418 lines above this hunk @@ -419,6 +419,25 @@ final class NativeNavigationUnitTests: XCTestCase { 419 419 XCTAssertNil ( CraftChrome . shared . tabAccessory ) 420 420 } 421 421 422 + func testDisappearingHiddenNativeTabCannotClearTheVisibleAccessory ( ) async throws { 423 + shell . open ( "/linked-details" ) 424 + let home = try XCTUnwrap ( stack ( "/" ) ) 425 + await displayWait ( "details accessory is visible" ) { 426 + home . transitionCoordinator = = nil & & CraftChrome . shared . tabAccessory ? . id = = "/capabilities" 427 + } 428 + let background = CraftNativeScreenController ( config : CraftHybrid . shared . config ) 429 + background . loadViewIfNeeded ( ) 430 + 431 + 432 + background . viewWillDisappear ( false ) 433 + XCTAssertEqual ( CraftChrome . shared . tabAccessory ? . id , "/capabilities" ) 434 + let visible = try XCTUnwrap ( home . topViewController as ? CraftNativeScreenController ) 435 + visible . viewWillDisappear ( false ) 436 + XCTAssertNil ( CraftChrome . shared . tabAccessory , "the owning screen must still clear its accessory" ) 437 + visible . screenVisibilityChanged ( true ) 438 + XCTAssertEqual ( CraftChrome . shared . tabAccessory ? . id , "/capabilities" ) 439 + } 440 + 422 441 func testCancelledColdSwipeRestoresTheVisibleScreensAccessory ( ) async throws { 423 442 let previous = CraftChrome . shared . tabAccessory 424 443 drag ( - 150 )