|
@@ -21,13 +21,23 @@
|
21
|
21
|
self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
|
22
|
22
|
}
|
23
|
23
|
|
24
|
|
-- (void)testApplyOptions_shouldSetTabBarItemBadgeWithDefault {
|
|
24
|
+- (void)testApplyOptions_shouldSetTabBarItemBadgeWithDefaultWhenParentIsUITabBarController {
|
|
25
|
+ UITabBarController* tabBarController = [[UITabBarController alloc] init];
|
|
26
|
+ [tabBarController setViewControllers:@[self.bindedViewController]];
|
25
|
27
|
[[self.bindedViewController expect] rnn_setTabBarItemBadge:nil];
|
26
|
28
|
[self.uut applyOptions:self.options];
|
27
|
29
|
[self.bindedViewController verify];
|
28
|
30
|
}
|
29
|
31
|
|
|
32
|
+- (void)testApplyOptions_shouldSetTabBarItemBadgeOnlyWhenParentIsUITabBarController {
|
|
33
|
+ [[self.bindedViewController reject] rnn_setTabBarItemBadge:[OCMArg any]];
|
|
34
|
+ [self.uut applyOptions:self.options];
|
|
35
|
+ [self.bindedViewController verify];
|
|
36
|
+}
|
|
37
|
+
|
30
|
38
|
- (void)testApplyOptions_shouldSetTabBarItemBadgeWithValue {
|
|
39
|
+ UITabBarController* tabBarController = [[UITabBarController alloc] init];
|
|
40
|
+ [tabBarController setViewControllers:@[self.bindedViewController]];
|
31
|
41
|
self.options.bottomTab.badge = [[Text alloc] initWithValue:@"badge"];
|
32
|
42
|
[[self.bindedViewController expect] rnn_setTabBarItemBadge:@"badge"];
|
33
|
43
|
[self.uut applyOptions:self.options];
|