|
@@ -225,6 +225,78 @@
|
225
|
225
|
|
226
|
226
|
}
|
227
|
227
|
|
|
228
|
+
|
|
229
|
+-(void)testTopBarLargeTitle_default {
|
|
230
|
+ __unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
|
|
231
|
+ [self.uut viewWillAppear:false];
|
|
232
|
+
|
|
233
|
+ XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeNever);
|
|
234
|
+}
|
|
235
|
+-(void)testTopBarLargeTitle_true {
|
|
236
|
+ self.options.topBar.largeTitle.visible = @(1);
|
|
237
|
+ __unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
|
|
238
|
+ [self.uut viewWillAppear:false];
|
|
239
|
+
|
|
240
|
+ XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeAlways);
|
|
241
|
+}
|
|
242
|
+-(void)testTopBarLargeTitle_false {
|
|
243
|
+ self.options.topBar.largeTitle.visible = @(0);
|
|
244
|
+ __unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
|
|
245
|
+ [self.uut viewWillAppear:false];
|
|
246
|
+
|
|
247
|
+ XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeNever);
|
|
248
|
+}
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+-(void)testTopBarLargeTitleFontSize_withoutTextFontFamily_withoutTextColor {
|
|
252
|
+ NSNumber* topBarTextFontSizeInput = @(15);
|
|
253
|
+ self.options.topBar.largeTitle.fontSize = topBarTextFontSizeInput;
|
|
254
|
+ __unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
|
|
255
|
+ [self.uut viewWillAppear:false];
|
|
256
|
+ UIFont* expectedFont = [UIFont systemFontOfSize:15];
|
|
257
|
+ XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
|
|
258
|
+}
|
|
259
|
+
|
|
260
|
+-(void)testTopBarLargeTitleFontSize_withoutTextFontFamily_withTextColor {
|
|
261
|
+ NSNumber* topBarTextFontSizeInput = @(15);
|
|
262
|
+ NSNumber* inputColor = @(0xFFFF0000);
|
|
263
|
+ self.options.topBar.largeTitle.fontSize = topBarTextFontSizeInput;
|
|
264
|
+ self.options.topBar.largeTitle.color = inputColor;
|
|
265
|
+ __unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
|
|
266
|
+ [self.uut viewWillAppear:false];
|
|
267
|
+ UIFont* expectedFont = [UIFont systemFontOfSize:15];
|
|
268
|
+ UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
|
|
269
|
+ XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
|
|
270
|
+ XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSColor"] isEqual:expectedColor]);
|
|
271
|
+}
|
|
272
|
+
|
|
273
|
+-(void)testTopBarLargeTitleFontSize_withTextFontFamily_withTextColor {
|
|
274
|
+ NSNumber* topBarTextFontSizeInput = @(15);
|
|
275
|
+ NSNumber* inputColor = @(0xFFFF0000);
|
|
276
|
+ NSString* inputFont = @"HelveticaNeue";
|
|
277
|
+ self.options.topBar.largeTitle.fontSize = topBarTextFontSizeInput;
|
|
278
|
+ self.options.topBar.largeTitle.color = inputColor;
|
|
279
|
+ self.options.topBar.largeTitle.fontFamily = inputFont;
|
|
280
|
+ __unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
|
|
281
|
+ [self.uut viewWillAppear:false];
|
|
282
|
+ UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
|
|
283
|
+ UIFont* expectedFont = [UIFont fontWithName:inputFont size:15];
|
|
284
|
+ XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
|
|
285
|
+ XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSColor"] isEqual:expectedColor]);
|
|
286
|
+}
|
|
287
|
+
|
|
288
|
+-(void)testTopBarLargeTitleFontSize_withTextFontFamily_withoutTextColor {
|
|
289
|
+ NSNumber* topBarTextFontSizeInput = @(15);
|
|
290
|
+ NSString* inputFont = @"HelveticaNeue";
|
|
291
|
+ self.options.topBar.largeTitle.fontSize = topBarTextFontSizeInput;
|
|
292
|
+ self.options.topBar.largeTitle.fontFamily = inputFont;
|
|
293
|
+ __unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
|
|
294
|
+ [self.uut viewWillAppear:false];
|
|
295
|
+ UIFont* expectedFont = [UIFont fontWithName:inputFont size:15];
|
|
296
|
+ XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
|
|
297
|
+}
|
|
298
|
+
|
|
299
|
+
|
228
|
300
|
-(void)testTopBarTextFontSize_withoutTextFontFamily_withoutTextColor {
|
229
|
301
|
NSNumber* topBarTextFontSizeInput = @(15);
|
230
|
302
|
self.options.topBar.title.fontSize = topBarTextFontSizeInput;
|
|
@@ -492,26 +564,6 @@
|
492
|
564
|
XCTAssertNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
|
493
|
565
|
}
|
494
|
566
|
|
495
|
|
--(void)testTopBarLargeTitle_default {
|
496
|
|
- __unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
|
497
|
|
- [self.uut viewWillAppear:false];
|
498
|
|
-
|
499
|
|
- XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeNever);
|
500
|
|
-}
|
501
|
|
--(void)testTopBarLargeTitle_true {
|
502
|
|
- self.options.topBar.largeTitle = @(1);
|
503
|
|
- __unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
|
504
|
|
- [self.uut viewWillAppear:false];
|
505
|
|
-
|
506
|
|
- XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeAlways);
|
507
|
|
-}
|
508
|
|
--(void)testTopBarLargeTitle_false {
|
509
|
|
- self.options.topBar.largeTitle = @(0);
|
510
|
|
- __unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
|
511
|
|
- [self.uut viewWillAppear:false];
|
512
|
|
-
|
513
|
|
- XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeNever);
|
514
|
|
-}
|
515
|
567
|
-(void)testTopBarBlur_false {
|
516
|
568
|
NSNumber* topBarBlurInput = @(0);
|
517
|
569
|
self.options.topBar.blur = topBarBlurInput;
|