|
@@ -161,11 +161,34 @@
|
161
|
161
|
RNNComponentViewController* boundViewController = [RNNComponentViewController new];
|
162
|
162
|
RNNLayoutInfo* layoutInfo = [self createLayoutInfoWithComponentId:@"componentId"];
|
163
|
163
|
boundViewController.layoutInfo = layoutInfo;
|
|
164
|
+ boundViewController.defaultOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
|
164
|
165
|
[self.uut boundViewController:boundViewController];
|
165
|
166
|
|
166
|
|
- self.options.topBar.title.component = [[RNNComponentOptions alloc] initWithDict:@{@"name": @"titleComponent"}];
|
|
167
|
+ self.options.topBar.title.component = [[RNNComponentOptions alloc] initWithDict:@{@"name": @"titleComponent", @"componentId": @"id"}];
|
167
|
168
|
|
168
|
|
- [[(id)self.componentRegistry expect] createComponentIfNotExists:self.options.topBar.title.component parentComponentId:self.uut.boundComponentId reactViewReadyBlock:[OCMArg any]];
|
|
169
|
+ [[(id)self.componentRegistry expect] createComponentIfNotExists:[OCMArg checkWithBlock:^BOOL(RNNComponentOptions* options) {
|
|
170
|
+ return [options.name.get isEqual:@"titleComponent"] &&
|
|
171
|
+ [options.componentId.get isEqual:@"id"];
|
|
172
|
+ }] parentComponentId:self.uut.boundComponentId reactViewReadyBlock:[OCMArg any]];
|
|
173
|
+ [self.uut renderComponents:self.options perform:nil];
|
|
174
|
+ [(id)self.componentRegistry verify];
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+ XCTAssertEqual(self.uut.boundComponentId, @"componentId");
|
|
178
|
+}
|
|
179
|
+
|
|
180
|
+- (void)testRenderComponentsCreateReactViewFromDefaultOptions {
|
|
181
|
+ RNNComponentViewController* boundViewController = [RNNComponentViewController new];
|
|
182
|
+ boundViewController.layoutInfo = [self createLayoutInfoWithComponentId:@"componentId"];
|
|
183
|
+ self.uut.defaultOptions = [[RNNNavigationOptions alloc] initEmptyOptions];
|
|
184
|
+ [self.uut boundViewController:boundViewController];
|
|
185
|
+
|
|
186
|
+ self.uut.defaultOptions.topBar.title.component = [[RNNComponentOptions alloc] initWithDict:@{@"name": @"titleComponent", @"componentId": @"id"}];
|
|
187
|
+
|
|
188
|
+ [[(id)self.componentRegistry expect] createComponentIfNotExists:[OCMArg checkWithBlock:^BOOL(RNNComponentOptions* options) {
|
|
189
|
+ return [options.name.get isEqual:@"titleComponent"] &&
|
|
190
|
+ [options.componentId.get isEqual:@"id"];
|
|
191
|
+ }] parentComponentId:self.uut.boundComponentId reactViewReadyBlock:[OCMArg any]];
|
169
|
192
|
[self.uut renderComponents:self.options perform:nil];
|
170
|
193
|
[(id)self.componentRegistry verify];
|
171
|
194
|
|