File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
iOS_SDK/OneSignalSDK/UnitTests Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -3265,6 +3265,32 @@ - (void)testNotificationJson {
32653265 XCTAssertEqualObjects (json[@" templateName" ], @" Template name" );
32663266}
32673267
3268+ - (void )testInAppMessageInternalJson {
3269+ NSDictionary *messageJson = @{
3270+ @" id" : OS_TEST_MESSAGE_ID,
3271+ @" variants" : @{
3272+ @" ios" : @{
3273+ @" default" : OS_TEST_MESSAGE_VARIANT_ID,
3274+ @" en" : OS_TEST_ENGLISH_VARIANT_ID
3275+ },
3276+ @" all" : @{
3277+ @" default" : @" some_message_id"
3278+ }
3279+ },
3280+ @" triggers" : @[],
3281+ @" has_liquid" : @true ,
3282+ };
3283+ OSInAppMessageInternal *message = [OSInAppMessageInternal instanceWithJson: messageJson];
3284+ NSDictionary *json = [message jsonRepresentation ];
3285+
3286+ XCTAssertEqualObjects (json[@" messageId" ], OS_TEST_MESSAGE_ID);
3287+ XCTAssertNil (json[@" id" ]);
3288+ XCTAssertEqualObjects (json[@" variants" ][@" ios" ][@" default" ], OS_TEST_MESSAGE_VARIANT_ID);
3289+ XCTAssertEqualObjects (json[@" variants" ][@" all" ][@" default" ], @" some_message_id" );
3290+ XCTAssertEqualObjects (json[@" triggers" ], @[]);
3291+ XCTAssertTrue (json[@" has_liquid" ]);
3292+ }
3293+
32683294- (void )testLaunchURL {
32693295
32703296 // 1. Init OneSignal with app start
You can’t perform that action at this time.
0 commit comments