|
@@ -87,6 +87,27 @@
|
87
|
87
|
XCTAssertNil([self.store findComponentForId:@"cntId1"]);
|
88
|
88
|
}
|
89
|
89
|
|
|
90
|
+- (void)testGetExternalComponentShouldRetrunSavedComponent {
|
|
91
|
+ UIViewController* testVC = [UIViewController new];
|
|
92
|
+ NSString *externalComponentId = @"extId1";
|
|
93
|
+ [self.store registerExternalComponent:externalComponentId callback:^UIViewController *(NSDictionary *props, RCTBridge *bridge) {
|
|
94
|
+ return testVC;
|
|
95
|
+ }];
|
|
96
|
+
|
|
97
|
+ UIViewController* savedComponent = [self.store getExternalComponent:externalComponentId props:nil bridge:nil];
|
|
98
|
+ XCTAssertEqual(testVC, savedComponent);
|
|
99
|
+}
|
|
100
|
+
|
|
101
|
+- (void)testComponentKeyForInstance_UknownComponentShouldReturnNil {
|
|
102
|
+ id result = [self.store componentKeyForInstance:[UIViewController new]];
|
|
103
|
+ XCTAssertNil(result);
|
|
104
|
+}
|
|
105
|
+
|
|
106
|
+-(void)testCleanStore {
|
|
107
|
+ [self.store clean];
|
|
108
|
+ XCTAssertFalse(self.store.pendingModalIdsToDismiss.count);
|
|
109
|
+ XCTAssertFalse(self.store.isReadyToReceiveCommands);
|
|
110
|
+}
|
90
|
111
|
|
91
|
112
|
#pragma mark - private
|
92
|
113
|
|