|
|
|
|
439
|
XCTAssertTrue([secondChild.tabBarItem.title isEqualToString:@"Second"]);
|
439
|
XCTAssertTrue([secondChild.tabBarItem.title isEqualToString:@"Second"]);
|
440
|
}
|
440
|
}
|
441
|
|
441
|
|
|
|
442
|
+- (void)testMergeOptions_shouldResolveTreeOptions {
|
|
|
443
|
+ [self.uut setReadyToReceiveCommands:true];
|
|
|
444
|
+ NSDictionary* mergeOptions = @{@"bottomTab": @{@"badge": @"Badge"}};
|
|
|
445
|
+
|
|
|
446
|
+ RNNNavigationOptions* firstChildOptions = [RNNNavigationOptions emptyOptions];
|
|
|
447
|
+
|
|
|
448
|
+ RNNNavigationOptions* secondChildOptions = [RNNNavigationOptions emptyOptions];
|
|
|
449
|
+ secondChildOptions.bottomTab.text = [Text withValue:@"Second"];
|
|
|
450
|
+ RNNNavigationOptions* stackOptions = [RNNNavigationOptions emptyOptions];
|
|
|
451
|
+ stackOptions.bottomTab.text = [Text withValue:@"First"];
|
|
|
452
|
+
|
|
|
453
|
+ RNNComponentViewController* firstChild = [RNNComponentViewController createWithComponentId:@"first" initialOptions:firstChildOptions];
|
|
|
454
|
+ RNNStackController* stack = [[RNNStackController alloc] initWithLayoutInfo:nil creator:nil options:stackOptions defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:@[firstChild]];
|
|
|
455
|
+ RNNComponentViewController* secondChild = [RNNComponentViewController createWithComponentId:@"second" initialOptions:secondChildOptions];
|
|
|
456
|
+
|
|
|
457
|
+ RNNBottomTabsController* tabBarController = [[RNNBottomTabsController alloc] initWithLayoutInfo:nil creator:nil options:[RNNNavigationOptions emptyOptions] defaultOptions:[[RNNNavigationOptions alloc] initEmptyOptions] presenter:[RNNBasePresenter new] bottomTabPresenter:[BottomTabPresenterCreator createWithDefaultOptions:[RNNNavigationOptions emptyOptions]] dotIndicatorPresenter:nil eventEmitter:_eventEmmiter childViewControllers:@[stack, secondChild] bottomTabsAttacher:nil];
|
|
|
458
|
+
|
|
|
459
|
+ OCMStub([self.controllerFactory createLayout:[OCMArg any]]).andReturn(tabBarController);
|
|
|
460
|
+ [self.mainWindow setRootViewController:tabBarController];
|
|
|
461
|
+ [secondChild viewWillAppear:YES];
|
|
|
462
|
+
|
|
|
463
|
+ [self.uut mergeOptions:firstChild.layoutInfo.componentId options:mergeOptions completion:^{
|
|
|
464
|
+
|
|
|
465
|
+ }];
|
|
|
466
|
+
|
|
|
467
|
+ XCTAssertTrue([stack.tabBarItem.badgeValue isEqualToString:@"Badge"]);
|
|
|
468
|
+ XCTAssertTrue([stack.tabBarItem.title isEqualToString:@"First"]);
|
|
|
469
|
+ XCTAssertTrue([secondChild.tabBarItem.title isEqualToString:@"Second"]);
|
|
|
470
|
+}
|
|
|
471
|
+
|
442
|
- (void)testShowModal_shouldShowAnimated {
|
472
|
- (void)testShowModal_shouldShowAnimated {
|
443
|
[self.uut setReadyToReceiveCommands:true];
|
473
|
[self.uut setReadyToReceiveCommands:true];
|
444
|
self.vc1.options = [[RNNNavigationOptions alloc] initEmptyOptions];
|
474
|
self.vc1.options = [[RNNNavigationOptions alloc] initEmptyOptions];
|