File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
playground/ios/NavigationTests Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ - (void)attach:(UITabBarController *)bottomTabsController {
7
7
[bottomTabsController.selectedViewController setReactViewReadyCallback: ^{
8
8
[bottomTabsController readyForPresentation ];
9
9
for (UIViewController *viewController in bottomTabsController.deselectedViewControllers ) {
10
+ dispatch_async (dispatch_get_main_queue (), ^{
10
11
[viewController render ];
12
+ });
11
13
}
12
14
}];
13
15
Original file line number Diff line number Diff line change @@ -554,8 +554,21 @@ - (void)testSetRoot_withBottomTabsAttachModeAfterInitialTab {
554
554
}];
555
555
556
556
[self waitForExpectationsWithTimeout: 10 handler: nil ];
557
- XCTAssertTrue (_vc1.isViewLoaded );
558
- XCTAssertTrue (_vc2.isViewLoaded );
557
+
558
+ XCTAssertTrue (self->_vc1 .isViewLoaded );
559
+
560
+ // Make sure the view is not loaded until the next main run loop.
561
+ XCTAssertFalse (self->_vc2 .isViewLoaded );
562
+
563
+
564
+ // Wait for the next main run-loop.
565
+ XCTestExpectation *viewLoadedExpectation = [self expectationWithDescription: @" Wait for _vc2.isViewLoaded" ];
566
+ dispatch_async (dispatch_get_main_queue (), ^{
567
+ XCTAssertTrue (self->_vc2 .isViewLoaded );
568
+ [viewLoadedExpectation fulfill ];
569
+ });
570
+
571
+ [self waitForExpectationsWithTimeout: 1 handler: nil ];
559
572
}
560
573
561
574
- (void )testSetRoot_withAnimation {
You can’t perform that action at this time.
0 commit comments