|
@@ -373,11 +373,9 @@
|
373
|
373
|
-(void)testOrientationTabsController_portrait {
|
374
|
374
|
NSArray* supportedOrientations = @[@"portrait"];
|
375
|
375
|
self.options.layout.orientation = supportedOrientations;
|
376
|
|
- __unused RNNTabBarController* vc = [[RNNTabBarController alloc] init];
|
377
|
|
- NSMutableArray* controllers = [NSMutableArray new];
|
|
376
|
+ NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
|
|
377
|
+ __unused RNNTabBarController* vc = [[RNNTabBarController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:[RNNViewControllerPresenter new] eventEmitter:nil childViewControllers:controllers];
|
378
|
378
|
|
379
|
|
- [controllers addObject:self.uut];
|
380
|
|
- [vc setViewControllers:controllers];
|
381
|
379
|
[self.uut viewWillAppear:false];
|
382
|
380
|
|
383
|
381
|
UIInterfaceOrientationMask expectedOrientation = UIInterfaceOrientationMaskPortrait;
|
|
@@ -387,11 +385,9 @@
|
387
|
385
|
-(void)testOrientationTabsController_portraitAndLandscape {
|
388
|
386
|
NSArray* supportedOrientations = @[@"portrait", @"landscape"];
|
389
|
387
|
self.options.layout.orientation = supportedOrientations;
|
390
|
|
- __unused RNNTabBarController* vc = [[RNNTabBarController alloc] init];
|
391
|
|
- NSMutableArray* controllers = [NSMutableArray new];
|
|
388
|
+ NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
|
|
389
|
+ __unused RNNTabBarController* vc = [[RNNTabBarController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:[RNNViewControllerPresenter new] eventEmitter:nil childViewControllers:controllers];
|
392
|
390
|
|
393
|
|
- [controllers addObject:self.uut];
|
394
|
|
- [vc setViewControllers:controllers];
|
395
|
391
|
[self.uut viewWillAppear:false];
|
396
|
392
|
|
397
|
393
|
UIInterfaceOrientationMask expectedOrientation = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscape);
|
|
@@ -401,11 +397,9 @@
|
401
|
397
|
-(void)testOrientationTabsController_all {
|
402
|
398
|
NSArray* supportedOrientations = @[@"all"];
|
403
|
399
|
self.options.layout.orientation = supportedOrientations;
|
404
|
|
- __unused RNNTabBarController* vc = [[RNNTabBarController alloc] init];
|
405
|
|
- NSMutableArray* controllers = [NSMutableArray new];
|
|
400
|
+ NSMutableArray* controllers = [[NSMutableArray alloc] initWithArray:@[self.uut]];
|
|
401
|
+ __unused RNNTabBarController* vc = [[RNNTabBarController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:[RNNViewControllerPresenter new] eventEmitter:nil childViewControllers:controllers];
|
406
|
402
|
|
407
|
|
- [controllers addObject:self.uut];
|
408
|
|
- [vc setViewControllers:controllers];
|
409
|
403
|
[self.uut viewWillAppear:false];
|
410
|
404
|
|
411
|
405
|
UIInterfaceOrientationMask expectedOrientation = UIInterfaceOrientationMaskAll;
|
|
@@ -417,7 +411,7 @@
|
417
|
411
|
self.uut = [[RNNRootViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[RNNViewControllerPresenter new] options:self.options defaultOptions:nil];
|
418
|
412
|
RNNNavigationController* nav = [[RNNNavigationController alloc] initWithLayoutInfo:nil creator:_creator options:nil defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:@[self.uut]];
|
419
|
413
|
|
420
|
|
- RNNUIBarButtonItem* button = (RNNUIBarButtonItem*)[nav.topViewController.navigationItem.rightBarButtonItems objectAtIndex:0];
|
|
414
|
+ RNNUIBarButtonItem* button = (RNNUIBarButtonItem*) nav.topViewController.navigationItem.rightBarButtonItems[0];
|
421
|
415
|
NSString* expectedButtonId = @"testId";
|
422
|
416
|
NSString* expectedTitle = @"test";
|
423
|
417
|
XCTAssertTrue([button.buttonId isEqualToString:expectedButtonId]);
|
|
@@ -442,7 +436,6 @@
|
442
|
436
|
//TODO: Determine how to tests buttonColor,buttonFontSize and buttonFontWeight?
|
443
|
437
|
}
|
444
|
438
|
|
445
|
|
-
|
446
|
439
|
-(void)testLeftButtonsWithTitle_withoutStyle {
|
447
|
440
|
self.options.topBar.leftButtons = @[@{@"id": @"testId", @"text": @"test"}];
|
448
|
441
|
self.uut = [[RNNRootViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[RNNViewControllerPresenter new] options:self.options defaultOptions:nil];
|