Skip to content

Commit f36acb5

Browse files
committed
splitting apart redisplay dict and messages dict unit tests
The previous test did not actually result in the migration running for the redisplay dictionary, but it worked because we set the NSKeyedUnarchiver class when doing the messages array migration.
1 parent 8df1277 commit f36acb5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

iOS_SDK/OneSignalSDK/UnitTests/MigrationTests.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ - (void)testIAMNilCacheToNilMigration {
288288
XCTAssertNil(retrievedDict);
289289
}
290290

291-
- (void)testIAMToInternalMigration {
291+
- (void)testIAMMessagesToInternalMigration {
292292
let limit = 5;
293293
let delay = 60;
294294
let message = [OSInAppMessageTestHelper testMessageWithRedisplayLimit:limit delay:@(delay)];
@@ -306,7 +306,13 @@ - (void)testIAMToInternalMigration {
306306
NSArray<OSInAppMessageInternal *>*retrievedArray = [OneSignalUserDefaults.initStandard
307307
getSavedCodeableDataForKey:OS_IAM_MESSAGES_ARRAY defaultValue:nil];
308308
XCTAssertEqualObjects(messages, retrievedArray);
309-
309+
}
310+
311+
- (void)testIAMRedisplayToInternalMigration {
312+
let limit = 5;
313+
let delay = 60;
314+
let message = [OSInAppMessageTestHelper testMessageWithRedisplayLimit:limit delay:@(delay)];
315+
message.isDisplayedInSession = true;
310316
// Cached Redisplay Messages
311317
NSMutableDictionary <NSString *, OSInAppMessageInternal *> *redisplayedInAppMessages = [NSMutableDictionary new];
312318
[redisplayedInAppMessages setObject:message forKey:message.messageId];
@@ -323,7 +329,4 @@ - (void)testIAMToInternalMigration {
323329
}
324330

325331

326-
327-
328-
329332
@end

0 commit comments

Comments
 (0)