|
@@ -16,19 +16,19 @@
|
16
|
16
|
XCTAssertTrue([options isKindOfClass:[RNNNavigationOptions class]]);
|
17
|
17
|
}
|
18
|
18
|
- (void)testAddsStyleFromDictionaryWithInit {
|
19
|
|
- RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:@{@"topBar": @{@"backgroundColor" : @(0xff0000ff)}}];
|
20
|
|
- XCTAssertTrue(options.topBar.backgroundColor);
|
|
19
|
+ RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:@{@"topBar": @{@"background" : @{@"color" : @(0xff0000ff)}}}];
|
|
20
|
+ XCTAssertTrue(options.topBar.background.color);
|
21
|
21
|
}
|
22
|
22
|
|
23
|
23
|
- (void)testChangeRNNNavigationOptionsDynamically {
|
24
|
|
- RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:@{@"topBar": @{@"backgroundColor" : @(0xff0000ff)}}];
|
|
24
|
+ RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:@{@"topBar": @{@"background" : @{@"color" : @(0xff0000ff)}}}];
|
25
|
25
|
NSDictionary* dynamicOptions = @{@"topBar": @{@"textColor" : @(0xffff00ff), @"title" : @{@"text": @"hello"}}};
|
26
|
26
|
[options mergeWith:dynamicOptions];
|
27
|
27
|
XCTAssertTrue([options.topBar.title.text isEqual:@"hello"]);
|
28
|
28
|
}
|
29
|
29
|
|
30
|
30
|
- (void)testChangeRNNNavigationOptionsWithInvalidProperties {
|
31
|
|
- RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:@{@"topBar": @{@"backgroundColor" : @(0xff0000ff)}}];
|
|
31
|
+ RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:@{@"topBar": @{@"background" : @{@"color" : @(0xff0000ff)}}}];
|
32
|
32
|
NSDictionary* dynamicOptions = @{@"topBar": @{@"titleeeee" : @"hello"}};
|
33
|
33
|
XCTAssertNoThrow([options mergeWith:dynamicOptions]);
|
34
|
34
|
}
|