diff --git a/lib/ios/RNNotificationsTests/RNNotificationEventHandlerTests.m b/lib/ios/RNNotificationsTests/RNNotificationEventHandlerTests.m index 23f11b80e2d528fce8cffe432c8956504d47b4da..919226f10baf6dda398c2be60e6869eb40ca251e 100644 --- a/lib/ios/RNNotificationsTests/RNNotificationEventHandlerTests.m +++ b/lib/ios/RNNotificationsTests/RNNotificationEventHandlerTests.m @@ -70,12 +70,14 @@ - (void)testDidReceiveNotificationResponse_ShouldEmitEvent { UNNotification* notification = [self createNotificationWithIdentifier:@"id" andUserInfo:@{@"extraKey": @"extraValue"}]; - UNNotificationResponse* response = [self createNotificationResponseWithIdentifier:@"id" andNotification:notification]; + UNNotificationResponse* response = [self createNotificationResponseWithIdentifier:@"actionId" andNotification:notification]; void (^testBlock)(void) = ^void() {}; - [[_mockedNotificationCenter expect] postNotificationName:RNNotificationOpened object:[OCMArg any] userInfo:[OCMArg checkWithBlock:^BOOL(id obj) { - return ([[obj valueForKey:@"identifier"] isEqualToString:@"id"] && - [[obj valueForKey:@"extraKey"] isEqualToString:@"extraValue"]); + [[_mockedNotificationCenter expect] postNotificationName:RNNotificationOpened object:[OCMArg any] userInfo:[OCMArg checkWithBlock:^BOOL(id response) { + NSDictionary* notification = response[@"notification"]; + NSDictionary* action = response[@"action"]; + return ([[notification valueForKey:@"identifier"] isEqualToString:@"id"] && + [[notification valueForKey:@"extraKey"] isEqualToString:@"extraValue"] && [action[@"identifier"] isEqualToString:@"actionId"]); }]]; [_uut didReceiveNotificationResponse:response completionHandler:testBlock]; [_mockedNotificationCenter verify];