react-native-navigation的迁移库

RNNCommandsHandlerTest.m 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. #import <XCTest/XCTest.h>
  2. #import <objc/runtime.h>
  3. #import <ReactNativeNavigation/RNNCommandsHandler.h>
  4. #import <ReactNativeNavigation/RNNNavigationOptions.h>
  5. #import "RNNTestRootViewCreator.h"
  6. #import <ReactNativeNavigation/RNNComponentViewController.h>
  7. #import <ReactNativeNavigation/RNNStackController.h>
  8. #import <ReactNativeNavigation/RNNErrorHandler.h>
  9. #import <OCMock/OCMock.h>
  10. #import "RNNLayoutManager.h"
  11. #import "RNNBottomTabsController.h"
  12. #import "BottomTabsAttachModeFactory.h"
  13. @interface MockUIApplication : NSObject
  14. -(UIWindow *)keyWindow;
  15. @end
  16. @implementation MockUIApplication
  17. - (UIWindow *)keyWindow {
  18. return [UIWindow new];
  19. }
  20. @end
  21. @interface MockUINavigationController : RNNStackController
  22. @property (nonatomic, strong) NSArray* willReturnVCs;
  23. @end
  24. @implementation MockUINavigationController
  25. -(NSArray<UIViewController *> *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated {
  26. return self.willReturnVCs;
  27. }
  28. -(NSArray<UIViewController *> *)popToRootViewControllerAnimated:(BOOL)animated {
  29. return self.willReturnVCs;
  30. }
  31. @end
  32. @interface RNNCommandsHandlerTest : XCTestCase
  33. @property (nonatomic, strong) RNNCommandsHandler* uut;
  34. @property (nonatomic, strong) id modalManager;
  35. @property (nonatomic, strong) RNNComponentViewController* vc1;
  36. @property (nonatomic, strong) RNNComponentViewController* vc2;
  37. @property (nonatomic, strong) RNNComponentViewController* vc3;
  38. @property (nonatomic, strong) MockUINavigationController* nvc;
  39. @property (nonatomic, strong) id mainWindow;
  40. @property (nonatomic, strong) id sharedApplication;
  41. @property (nonatomic, strong) id controllerFactory;
  42. @property (nonatomic, strong) id overlayManager;
  43. @property (nonatomic, strong) id eventEmmiter;
  44. @property (nonatomic, strong) id creator;
  45. @end
  46. @implementation RNNCommandsHandlerTest
  47. - (void)setUp {
  48. [super setUp];
  49. self.creator = [OCMockObject partialMockForObject:[RNNTestRootViewCreator new]];
  50. self.mainWindow = [OCMockObject partialMockForObject:[UIWindow new]];
  51. self.eventEmmiter = [OCMockObject partialMockForObject:[RNNEventEmitter new]];
  52. self.overlayManager = [OCMockObject partialMockForObject:[RNNOverlayManager new]];
  53. self.modalManager = [OCMockObject partialMockForObject:[RNNModalManager new]];
  54. self.controllerFactory = [OCMockObject partialMockForObject:[[RNNControllerFactory alloc] initWithRootViewCreator:nil eventEmitter:self.eventEmmiter store:nil componentRegistry:nil andBridge:nil bottomTabsAttachModeFactory:[BottomTabsAttachModeFactory new]]];
  55. self.uut = [[RNNCommandsHandler alloc] initWithControllerFactory:self.controllerFactory eventEmitter:self.eventEmmiter stackManager:[RNNNavigationStackManager new] modalManager:self.modalManager overlayManager:self.overlayManager mainWindow:_mainWindow];
  56. self.vc1 = [self generateComponentWithComponentId:@"1"];
  57. self.vc2 = [self generateComponentWithComponentId:@"2"];
  58. self.vc3 = [self generateComponentWithComponentId:@"3"];
  59. _nvc = [[MockUINavigationController alloc] init];
  60. [_nvc setViewControllers:@[self.vc1, self.vc2, self.vc3]];
  61. OCMStub([self.sharedApplication keyWindow]).andReturn(self.mainWindow);
  62. }
  63. - (RNNComponentViewController *)generateComponentWithComponentId:(NSString *)componentId {
  64. RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] init];
  65. layoutInfo.componentId = componentId;
  66. return [[RNNComponentViewController alloc] initWithLayoutInfo:layoutInfo rootViewCreator:_creator eventEmitter:nil presenter:[RNNComponentPresenter new] options:[[RNNNavigationOptions alloc] initWithDict:@{}] defaultOptions:nil];
  67. }
  68. - (void)testAssertReadyForEachMethodThrowsExceptoins {
  69. NSArray* methods = [self getPublicMethodNamesForObject:self.uut];
  70. [self.uut setReadyToReceiveCommands:false];
  71. for (NSString* methodName in methods) {
  72. SEL s = NSSelectorFromString(methodName);
  73. IMP imp = [self.uut methodForSelector:s];
  74. void (*func)(id, SEL, id, id, id, id, id) = (void *)imp;
  75. XCTAssertThrowsSpecificNamed(func(self.uut,s, nil, nil, nil, nil, nil), NSException, @"BridgeNotLoadedError");
  76. }
  77. }
  78. -(NSArray*) getPublicMethodNamesForObject:(NSObject*)obj{
  79. NSMutableArray* skipMethods = [NSMutableArray new];
  80. [skipMethods addObject:@"initWithControllerFactory:eventEmitter:stackManager:modalManager:overlayManager:mainWindow:"];
  81. [skipMethods addObject:@"assertReady"];
  82. [skipMethods addObject:@"setReadyToReceiveCommands:"];
  83. [skipMethods addObject:@"readyToReceiveCommands"];
  84. [skipMethods addObject:@".cxx_destruct"];
  85. [skipMethods addObject:@"dismissedModal:"];
  86. [skipMethods addObject:@"dismissedMultipleModals:"];
  87. NSMutableArray* result = [NSMutableArray new];
  88. // count and names:
  89. int i=0;
  90. unsigned int mc = 0;
  91. Method * mlist = class_copyMethodList(object_getClass(obj), &mc);
  92. for(i=0; i<mc; i++) {
  93. NSString *methodName = [NSString stringWithUTF8String:sel_getName(method_getName(mlist[i]))];
  94. // filter skippedMethods
  95. if (methodName && ![skipMethods containsObject:methodName]) {
  96. [result addObject:methodName];
  97. }
  98. }
  99. return result;
  100. }
  101. -(void)testDynamicStylesMergeWithStaticStyles {
  102. RNNNavigationOptions* initialOptions = [[RNNNavigationOptions alloc] initWithDict:@{}];
  103. initialOptions.topBar.title.text = [[Text alloc] initWithValue:@"the title"];
  104. RNNLayoutInfo* layoutInfo = [RNNLayoutInfo new];
  105. RNNTestRootViewCreator* creator = [[RNNTestRootViewCreator alloc] init];
  106. RNNComponentPresenter* presenter = [[RNNComponentPresenter alloc] init];
  107. RNNComponentViewController* vc = [[RNNComponentViewController alloc] initWithLayoutInfo:layoutInfo rootViewCreator:creator eventEmitter:nil presenter:presenter options:initialOptions defaultOptions:nil];
  108. RNNStackController* nav = [[RNNStackController alloc] initWithLayoutInfo:nil creator:creator options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:[[RNNStackPresenter alloc] init] eventEmitter:nil childViewControllers:@[vc]];
  109. [vc viewWillAppear:false];
  110. XCTAssertTrue([vc.navigationItem.title isEqual:@"the title"]);
  111. [self.uut setReadyToReceiveCommands:true];
  112. NSDictionary* dictFromJs = @{@"topBar": @{@"background" : @{@"color" : @(0xFFFF0000)}}};
  113. UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
  114. [self.uut mergeOptions:@"componentId" options:dictFromJs completion:^{
  115. XCTAssertTrue([vc.navigationItem.title isEqual:@"the title"]);
  116. XCTAssertTrue([nav.navigationBar.barTintColor isEqual:expectedColor]);
  117. }];
  118. }
  119. - (void)testMergeOptions_shouldOverrideOptions {
  120. RNNNavigationOptions* initialOptions = [[RNNNavigationOptions alloc] initWithDict:@{}];
  121. initialOptions.topBar.title.text = [[Text alloc] initWithValue:@"the title"];
  122. RNNComponentPresenter* presenter = [[RNNComponentPresenter alloc] init];
  123. RNNComponentViewController* vc = [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:[[RNNTestRootViewCreator alloc] init] eventEmitter:nil presenter:presenter options:initialOptions defaultOptions:nil];
  124. __unused RNNStackController* nav = [[RNNStackController alloc] initWithRootViewController:vc];
  125. [vc viewWillAppear:false];
  126. XCTAssertTrue([vc.navigationItem.title isEqual:@"the title"]);
  127. [self.uut setReadyToReceiveCommands:true];
  128. NSDictionary* dictFromJs = @{@"topBar": @{@"title" : @{@"text" : @"new title"}}};
  129. [self.uut mergeOptions:@"componentId" options:dictFromJs completion:^{
  130. XCTAssertTrue([vc.navigationItem.title isEqual:@"new title"]);
  131. }];
  132. }
  133. - (void)testShowOverlay_createLayout {
  134. [self.uut setReadyToReceiveCommands:true];
  135. OCMStub([self.overlayManager showOverlayWindow:[OCMArg any]]);
  136. NSDictionary* layout = @{};
  137. [[self.controllerFactory expect] createLayout:layout];
  138. [self.uut showOverlay:layout commandId:@"" completion:^{}];
  139. [self.controllerFactory verify];
  140. }
  141. - (void)testShowOverlay_saveToStore {
  142. [self.uut setReadyToReceiveCommands:true];
  143. OCMStub([self.overlayManager showOverlayWindow:[OCMArg any]]);
  144. OCMStub([self.controllerFactory createLayout:[OCMArg any]]);
  145. [[self.controllerFactory expect] createLayout:[OCMArg any]];
  146. [self.uut showOverlay:@{} commandId:@"" completion:^{}];
  147. [self.overlayManager verify];
  148. }
  149. - (void)testShowOverlay_withCreatedLayout {
  150. [self.uut setReadyToReceiveCommands:true];
  151. UIViewController* layoutVC = [self generateComponentWithComponentId:nil];
  152. OCMStub([self.controllerFactory createLayout:[OCMArg any]]).andReturn(layoutVC);
  153. [[self.overlayManager expect] showOverlayWindow:[OCMArg any]];
  154. [self.uut showOverlay:@{} commandId:@"" completion:^{}];
  155. [self.overlayManager verify];
  156. }
  157. - (void)testShowOverlay_invokeNavigationCommandEventWithLayout {
  158. [self.uut setReadyToReceiveCommands:true];
  159. OCMStub([self.overlayManager showOverlayWindow:[OCMArg any]]);
  160. id mockedVC = [OCMockObject partialMockForObject:self.vc1];
  161. OCMStub([self.controllerFactory createLayout:[OCMArg any]]).andReturn(mockedVC);
  162. NSDictionary* layout = @{};
  163. [[self.eventEmmiter expect] sendOnNavigationCommandCompletion:@"showOverlay" commandId:[OCMArg any] params:[OCMArg any]];
  164. [self.uut showOverlay:layout commandId:@"" completion:^{}];
  165. [self.eventEmmiter verify];
  166. }
  167. - (void)testDismissOverlay_findComponentFromLayoutManager {
  168. [self.uut setReadyToReceiveCommands:true];
  169. NSString* componentId = @"componentId";
  170. id classMock = OCMClassMock([RNNLayoutManager class]);
  171. [[classMock expect] findComponentForId:componentId];
  172. [self.uut dismissOverlay:componentId commandId:@"" completion:^{} rejection:^(NSString *code, NSString *message, NSError *error) {}];
  173. [classMock verify];
  174. }
  175. - (void)testDismissOverlay_dismissReturnedViewController {
  176. [self.uut setReadyToReceiveCommands:true];
  177. NSString* componentId = @"componentId";
  178. UIViewController* returnedView = [UIViewController new];
  179. id classMock = OCMClassMock([RNNLayoutManager class]);
  180. OCMStub(ClassMethod([classMock findComponentForId:componentId])).andReturn(returnedView);
  181. [[self.overlayManager expect] dismissOverlay:returnedView];
  182. [self.uut dismissOverlay:componentId commandId:@"" completion:^{} rejection:^(NSString *code, NSString *message, NSError *error) {}];
  183. [self.overlayManager verify];
  184. }
  185. - (void)testDismissOverlay_handleErrorIfNoOverlayExists {
  186. [self.uut setReadyToReceiveCommands:true];
  187. NSString* componentId = @"componentId";
  188. id errorHandlerMockClass = [OCMockObject mockForClass:[RNNErrorHandler class]];
  189. [[errorHandlerMockClass expect] reject:[OCMArg any] withErrorCode:1010 errorDescription:[OCMArg any]];
  190. [self.uut dismissOverlay:componentId commandId:@"" completion:[OCMArg any] rejection:[OCMArg any]];
  191. [errorHandlerMockClass verify];
  192. }
  193. - (void)testDismissOverlay_invokeNavigationCommandEvent {
  194. [self.uut setReadyToReceiveCommands:true];
  195. NSString* componentId = @"componentId";
  196. id classMock = OCMClassMock([RNNLayoutManager class]);
  197. OCMStub(ClassMethod([classMock findComponentForId:componentId])).andReturn([UIViewController new]);
  198. [[self.eventEmmiter expect] sendOnNavigationCommandCompletion:@"dismissOverlay" commandId:[OCMArg any] params:[OCMArg any]];
  199. [self.uut dismissOverlay:componentId commandId:@"" completion:^{
  200. } rejection:^(NSString *code, NSString *message, NSError *error) {}];
  201. [self.eventEmmiter verify];
  202. }
  203. - (void)testSetRoot_setRootViewControllerOnMainWindow {
  204. [self.uut setReadyToReceiveCommands:true];
  205. OCMStub([self.controllerFactory createLayout:[OCMArg any]]).andReturn(self.vc1);
  206. [[self.mainWindow expect] setRootViewController:self.vc1];
  207. [self.uut setRoot:@{} commandId:@"" completion:^{}];
  208. [self.mainWindow verify];
  209. }
  210. - (void)testSetStackRoot_resetStackWithSingleComponent {
  211. OCMStub([self.controllerFactory createChildrenLayout:[OCMArg any]]).andReturn(@[self.vc2]);
  212. [self.uut setReadyToReceiveCommands:true];
  213. id classMock = OCMClassMock([RNNLayoutManager class]);
  214. OCMStub(ClassMethod([classMock findComponentForId:@"vc1"])).andReturn(_nvc);
  215. self.vc2.options.animations.setStackRoot.enable = [[Bool alloc] initWithBOOL:NO];
  216. [self.uut setStackRoot:@"vc1" commandId:@"" children:nil completion:^{
  217. } rejection:^(NSString *code, NSString *message, NSError *error) {
  218. }];
  219. XCTAssertEqual(_nvc.viewControllers.firstObject, self.vc2);
  220. XCTAssertEqual(_nvc.viewControllers.count, 1);
  221. }
  222. - (void)testSetStackRoot_setMultipleChildren {
  223. NSArray* newViewControllers = @[_vc1, _vc3];
  224. id classMock = OCMClassMock([RNNLayoutManager class]);
  225. OCMStub(ClassMethod([classMock findComponentForId:@"vc1"])).andReturn(_nvc);
  226. OCMStub([self.controllerFactory createChildrenLayout:[OCMArg any]]).andReturn(newViewControllers);
  227. [self.uut setReadyToReceiveCommands:true];
  228. _vc3.options.animations.setStackRoot.enable = [[Bool alloc] initWithBOOL:NO];
  229. [self.uut setStackRoot:@"vc1" commandId:@"" children:nil completion:^{
  230. } rejection:^(NSString *code, NSString *message, NSError *error) {
  231. }];
  232. XCTAssertTrue([_nvc.viewControllers isEqual:newViewControllers]);
  233. }
  234. - (void)testSetStackRoot_callRenderTreeAndWaitOnce {
  235. id vc1Mock = [OCMockObject partialMockForObject:_vc1];
  236. id vc2Mock = [OCMockObject partialMockForObject:_vc2];
  237. NSArray* newViewControllers = @[vc1Mock, vc2Mock];
  238. OCMStub([self.controllerFactory createChildrenLayout:[OCMArg any]]).andReturn(newViewControllers);
  239. [self.uut setReadyToReceiveCommands:true];
  240. [self.uut setStackRoot:@"vc1" commandId:@"" children:nil completion:^{
  241. } rejection:^(NSString *code, NSString *message, NSError *error) {
  242. }];
  243. [[vc1Mock expect] render];
  244. [[vc2Mock expect] render];
  245. }
  246. - (void)testSetStackRoot_waitForRender {
  247. _vc2.options.animations.setStackRoot.waitForRender = [[Bool alloc] initWithBOOL:YES];
  248. id vc1Mock = OCMPartialMock(_vc1);
  249. id vc2Mock = OCMPartialMock(_vc2);
  250. NSArray* newViewControllers = @[vc1Mock, vc2Mock];
  251. OCMStub([self.controllerFactory createChildrenLayout:[OCMArg any]]).andReturn(newViewControllers);
  252. [self.uut setReadyToReceiveCommands:true];
  253. [self.uut setStackRoot:@"vc1" commandId:@"" children:nil completion:^{
  254. } rejection:^(NSString *code, NSString *message, NSError *error) {
  255. }];
  256. [[vc1Mock expect] render];
  257. [[vc2Mock expect] render];
  258. }
  259. - (void)testSetRoot_waitForRenderTrue {
  260. [self.uut setReadyToReceiveCommands:true];
  261. self.vc1.options = [[RNNNavigationOptions alloc] initEmptyOptions];
  262. self.vc1.options.animations.setRoot.waitForRender = [[Bool alloc] initWithBOOL:YES];
  263. id mockedVC = [OCMockObject partialMockForObject:self.vc1];
  264. OCMStub([self.controllerFactory createLayout:[OCMArg any]]).andReturn(mockedVC);
  265. [[mockedVC expect] render];
  266. [self.uut setRoot:@{} commandId:@"" completion:^{}];
  267. [mockedVC verify];
  268. }
  269. - (void)testSetRoot_waitForRenderFalse {
  270. [self.uut setReadyToReceiveCommands:true];
  271. self.vc1.options = [[RNNNavigationOptions alloc] initEmptyOptions];
  272. self.vc1.options.animations.setRoot.waitForRender = [[Bool alloc] initWithBOOL:NO];
  273. id mockedVC = [OCMockObject partialMockForObject:self.vc1];
  274. OCMStub([self.controllerFactory createLayout:[OCMArg any]]).andReturn(mockedVC);
  275. [[mockedVC expect] render];
  276. [self.uut setRoot:@{} commandId:@"" completion:^{}];
  277. [mockedVC verify];
  278. }
  279. - (void)testSetRoot_withBottomTabsAttachModeTogether {
  280. [self.uut setReadyToReceiveCommands:true];
  281. RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initEmptyOptions];
  282. options.bottomTabs.tabsAttachMode = [[BottomTabsAttachMode alloc] initWithValue:@"together"];
  283. BottomTabsBaseAttacher* attacher = [[[BottomTabsAttachModeFactory alloc] initWithDefaultOptions:nil] fromOptions:options];
  284. RNNBottomTabsController* tabBarController = [[RNNBottomTabsController alloc] initWithLayoutInfo:nil creator:nil options:options defaultOptions:[[RNNNavigationOptions alloc] initEmptyOptions] presenter:[RNNBasePresenter new] eventEmitter:_eventEmmiter childViewControllers:@[_vc1, _vc2] bottomTabsAttacher:attacher];
  285. OCMStub([self.controllerFactory createLayout:[OCMArg any]]).andReturn(tabBarController);
  286. [self.uut setRoot:@{} commandId:@"" completion:^{}];
  287. XCTAssertTrue(_vc1.isViewLoaded);
  288. XCTAssertTrue(_vc2.isViewLoaded);
  289. XCTAssertEqual(_vc1.view.tag, 1);
  290. XCTAssertEqual(_vc2.view.tag, 2);
  291. }
  292. - (void)testSetRoot_withBottomTabsAttachModeOnSwitchToTab {
  293. [self.uut setReadyToReceiveCommands:true];
  294. RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initEmptyOptions];
  295. options.bottomTabs.tabsAttachMode = [[BottomTabsAttachMode alloc] initWithValue:@"onSwitchToTab"];
  296. options.animations.setRoot.waitForRender = [[Bool alloc] initWithBOOL:YES];
  297. BottomTabsBaseAttacher* attacher = [[[BottomTabsAttachModeFactory alloc] initWithDefaultOptions:nil] fromOptions:options];
  298. RNNBottomTabsController* tabBarController = [[RNNBottomTabsController alloc] initWithLayoutInfo:nil creator:nil options:options defaultOptions:[[RNNNavigationOptions alloc] initEmptyOptions] presenter:[RNNBasePresenter new] eventEmitter:_eventEmmiter childViewControllers:@[_vc1, _vc2] bottomTabsAttacher:attacher];
  299. OCMStub([self.controllerFactory createLayout:[OCMArg any]]).andReturn(tabBarController);
  300. [self.uut setRoot:@{} commandId:@"" completion:^{}];
  301. XCTAssertTrue(_vc1.isViewLoaded);
  302. XCTAssertFalse(_vc2.isViewLoaded);
  303. [tabBarController setSelectedIndex:1];
  304. XCTAssertTrue(_vc2.isViewLoaded);
  305. }
  306. - (void)testSetRoot_withBottomTabsAttachModeAfterInitialTab {
  307. [self.uut setReadyToReceiveCommands:true];
  308. RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initEmptyOptions];
  309. options.bottomTabs.tabsAttachMode = [[BottomTabsAttachMode alloc] initWithValue:@"afterInitialTab"];
  310. options.animations.setRoot.waitForRender = [[Bool alloc] initWithBOOL:YES];
  311. BottomTabsBaseAttacher* attacher = [[[BottomTabsAttachModeFactory alloc] initWithDefaultOptions:nil] fromOptions:options];
  312. RNNBottomTabsController* tabBarController = [[RNNBottomTabsController alloc] initWithLayoutInfo:nil creator:nil options:options defaultOptions:[[RNNNavigationOptions alloc] initEmptyOptions] presenter:[RNNBasePresenter new] eventEmitter:_eventEmmiter childViewControllers:@[_vc1, _vc2] bottomTabsAttacher:attacher];
  313. OCMStub([self.controllerFactory createLayout:[OCMArg any]]).andReturn(tabBarController);
  314. [self.uut setRoot:@{} commandId:@"" completion:^{
  315. XCTAssertFalse(self->_vc2.isViewLoaded);
  316. }];
  317. XCTAssertTrue(_vc1.isViewLoaded);
  318. XCTAssertTrue(_vc2.isViewLoaded);
  319. }
  320. - (void)testShowModal_shouldShowAnimated {
  321. [self.uut setReadyToReceiveCommands:true];
  322. self.vc1.options = [[RNNNavigationOptions alloc] initEmptyOptions];
  323. self.vc1.options.animations.showModal.enable = [[Bool alloc] initWithBOOL:YES];
  324. id mockedVC = [OCMockObject partialMockForObject:self.vc1];
  325. OCMStub([self.controllerFactory createLayout:[OCMArg any]]).andReturn(mockedVC);
  326. [[self.modalManager expect] showModal:mockedVC animated:YES hasCustomAnimation:NO completion:[OCMArg any]];
  327. [self.uut showModal:@{} commandId:@"showModal" completion:^(NSString *componentId) {
  328. }];
  329. [self.modalManager verify];
  330. }
  331. @end