|
@@ -42,6 +42,7 @@
|
42
|
42
|
@interface RNNCommandsHandlerTest : XCTestCase
|
43
|
43
|
|
44
|
44
|
@property (nonatomic, strong) RNNCommandsHandler* uut;
|
|
45
|
+@property (nonatomic, strong) id modalManager;
|
45
|
46
|
@property (nonatomic, strong) RNNRootViewController* vc1;
|
46
|
47
|
@property (nonatomic, strong) RNNRootViewController* vc2;
|
47
|
48
|
@property (nonatomic, strong) RNNRootViewController* vc3;
|
|
@@ -61,8 +62,9 @@
|
61
|
62
|
self.mainWindow = [OCMockObject partialMockForObject:[UIWindow new]];
|
62
|
63
|
self.eventEmmiter = [OCMockObject partialMockForObject:[RNNEventEmitter new]];
|
63
|
64
|
self.overlayManager = [OCMockObject partialMockForObject:[RNNOverlayManager new]];
|
|
65
|
+ self.modalManager = [OCMockObject partialMockForObject:[RNNModalManager new]];
|
64
|
66
|
self.controllerFactory = [OCMockObject partialMockForObject:[[RNNControllerFactory alloc] initWithRootViewCreator:nil eventEmitter:self.eventEmmiter store:nil componentRegistry:nil andBridge:nil]];
|
65
|
|
- self.uut = [[RNNCommandsHandler alloc] initWithControllerFactory:self.controllerFactory eventEmitter:self.eventEmmiter stackManager:[RNNNavigationStackManager new] modalManager:[RNNModalManager new] overlayManager:self.overlayManager mainWindow:_mainWindow];
|
|
67
|
+ self.uut = [[RNNCommandsHandler alloc] initWithControllerFactory:self.controllerFactory eventEmitter:self.eventEmmiter stackManager:[RNNNavigationStackManager new] modalManager:self.modalManager overlayManager:self.overlayManager mainWindow:_mainWindow];
|
66
|
68
|
self.vc1 = [RNNRootViewController new];
|
67
|
69
|
self.vc2 = [RNNRootViewController new];
|
68
|
70
|
self.vc3 = [RNNRootViewController new];
|
|
@@ -313,4 +315,20 @@
|
313
|
315
|
[mockedVC verify];
|
314
|
316
|
}
|
315
|
317
|
|
|
318
|
+- (void)testShowModal_shouldShowAnimated {
|
|
319
|
+ [self.uut setReadyToReceiveCommands:true];
|
|
320
|
+ self.vc1.options = [[RNNNavigationOptions alloc] initEmptyOptions];
|
|
321
|
+ self.vc1.options.animations.showModal.enable = [[Bool alloc] initWithBOOL:YES];
|
|
322
|
+
|
|
323
|
+ id mockedVC = [OCMockObject partialMockForObject:self.vc1];
|
|
324
|
+ OCMStub([self.controllerFactory createLayout:[OCMArg any]]).andReturn(mockedVC);
|
|
325
|
+
|
|
326
|
+ [[self.modalManager expect] showModal:mockedVC animated:YES hasCustomAnimation:NO completion:[OCMArg any]];
|
|
327
|
+ [self.uut showModal:@{} commandId:@"showModal" completion:^(NSString *componentId) {
|
|
328
|
+
|
|
329
|
+ }];
|
|
330
|
+ [self.modalManager verify];
|
|
331
|
+}
|
|
332
|
+
|
|
333
|
+
|
316
|
334
|
@end
|