|
@@ -21,7 +21,7 @@
|
21
|
21
|
_vc2 = [[RNNRootViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[[RNNViewControllerPresenter alloc] init] options:nil];
|
22
|
22
|
_vc3 = [UIViewController new];
|
23
|
23
|
|
24
|
|
- self.uut = [[RNNNavigationController alloc] initWithLayoutInfo:nil childViewControllers:@[_vc1] options:[[RNNNavigationOptions alloc] initWithDict:@{}] presenter:[[RNNViewControllerPresenter alloc] init]];
|
|
24
|
+ self.uut = [[RNNNavigationController alloc] initWithLayoutInfo:nil childViewControllers:@[_vc1, _vc2] options:[[RNNNavigationOptions alloc] initWithDict:@{}] presenter:[[RNNViewControllerPresenter alloc] init]];
|
25
|
25
|
}
|
26
|
26
|
|
27
|
27
|
- (void)testInitWithLayoutInfo_shouldBindPresenter {
|
|
@@ -68,16 +68,16 @@
|
68
|
68
|
XCTAssertTrue(self.uut.interactivePopGestureRecognizer.enabled);
|
69
|
69
|
}
|
70
|
70
|
|
71
|
|
-//- (void)testRootBackgroundImage {
|
72
|
|
-// UIImage* rootBackgroundImage = [[UIImage alloc] init];
|
73
|
|
-// RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initEmptyOptions];
|
74
|
|
-// options.rootBackgroundImage = rootBackgroundImage;
|
75
|
|
-//
|
76
|
|
-// self.uut = [self createNavigationControllerWithOptions:options];
|
77
|
|
-// [self.uut viewWillAppear:false];
|
78
|
|
-//
|
79
|
|
-// XCTAssertTrue([[(UIImageView*)self.uut.view.subviews[0] image] isEqual:rootBackgroundImage]);
|
80
|
|
-//}
|
|
71
|
+- (void)testRootBackgroundImage {
|
|
72
|
+ UIImage* rootBackgroundImage = [[UIImage alloc] init];
|
|
73
|
+ RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initEmptyOptions];
|
|
74
|
+ options.rootBackgroundImage = [[Image alloc] initWithValue:rootBackgroundImage];
|
|
75
|
+
|
|
76
|
+ self.uut = [self createNavigationControllerWithOptions:options];
|
|
77
|
+ [self.uut onChildWillAppear];
|
|
78
|
+
|
|
79
|
+ XCTAssertTrue([[(UIImageView*)self.uut.view.subviews[0] image] isEqual:rootBackgroundImage]);
|
|
80
|
+}
|
81
|
81
|
|
82
|
82
|
- (void)testTopBarBackgroundClipToBounds_true {
|
83
|
83
|
RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initEmptyOptions];
|
|
@@ -98,6 +98,14 @@
|
98
|
98
|
XCTAssertFalse(self.uut.navigationController.navigationBar.clipsToBounds);
|
99
|
99
|
}
|
100
|
100
|
|
|
101
|
+- (void)testTabBarItemShouldReturnFirstChildTabBarItem {
|
|
102
|
+ XCTAssertEqual(self.uut.tabBarItem, self.uut.childViewControllers.firstObject.tabBarItem);
|
|
103
|
+}
|
|
104
|
+
|
|
105
|
+- (void)testSupportedOrientationsShouldReturnCurrentChildSupportedOrientations {
|
|
106
|
+ XCTAssertEqual(self.uut.supportedInterfaceOrientations, self.uut.getCurrentChild.supportedInterfaceOrientations);
|
|
107
|
+}
|
|
108
|
+
|
101
|
109
|
- (RNNNavigationController *)createNavigationControllerWithOptions:(RNNNavigationOptions *)options {
|
102
|
110
|
return [[RNNNavigationController alloc] initWithLayoutInfo:nil childViewControllers:@[_vc1] options:options presenter:[[RNNNavigationControllerPresenter alloc] init]];
|
103
|
111
|
}
|