@@ -79,6 +79,10 @@ @interface RCNUserDefaultsManager (Test)
79
79
+ (NSUserDefaults *)sharedUserDefaultsForBundleIdentifier : (NSString *)bundleIdentifier ;
80
80
@end
81
81
82
+ @interface RCNConfigSettings (Test)
83
+ - (NSString *)nextRequestWithUserProperties : (NSDictionary *)userProperties ;
84
+ @end
85
+
82
86
typedef NS_ENUM (NSInteger , RCNTestRCInstance) {
83
87
RCNTestRCInstanceDefault,
84
88
RCNTestRCInstanceSecondNamespace,
@@ -1415,6 +1419,29 @@ - (void)testSetFetchTimeoutConfigSetting {
1415
1419
}
1416
1420
}
1417
1421
1422
+ - (void )testFetchRequestWithUserProperties {
1423
+ NSDictionary *userProperties = @{@" user_key" : @" user_value" };
1424
+ NSString *req = [_settings nextRequestWithUserProperties: userProperties];
1425
+
1426
+ XCTAssertTrue ([req containsString: @" analytics_user_properties:{\" user_key\" :\" user_value\" }" ]);
1427
+ }
1428
+
1429
+ - (void )testFetchRequestWithFirstOpenTimeAndUserProperties {
1430
+ NSDictionary *userProperties = @{@" _fot" : @1649116800000 , @" user_key" : @" user_value" };
1431
+ NSString *req = [_settings nextRequestWithUserProperties: userProperties];
1432
+
1433
+ XCTAssertTrue ([req containsString: @" first_open_time:'2022-04-05T00:00:00Z'" ]);
1434
+ XCTAssertTrue ([req containsString: @" analytics_user_properties:{\" user_key\" :\" user_value\" }" ]);
1435
+ }
1436
+
1437
+ - (void )testFetchRequestFirstOpenTimeOnly {
1438
+ NSDictionary *userProperties = @{@" _fot" : @1649116800000 };
1439
+ NSString *req = [_settings nextRequestWithUserProperties: userProperties];
1440
+
1441
+ XCTAssertTrue ([req containsString: @" first_open_time:'2022-04-05T00:00:00Z'" ]);
1442
+ XCTAssertFalse ([req containsString: @" analytics_user_properties" ]);
1443
+ }
1444
+
1418
1445
#pragma mark - Public Factory Methods
1419
1446
1420
1447
- (void )testConfigureConfigWithValidInput {
0 commit comments