Commit 8cf658f8 authored by yogevbd's avatar yogevbd

Fix iOS unit tests

parent f12b10e0
...@@ -70,12 +70,14 @@ ...@@ -70,12 +70,14 @@
- (void)testDidReceiveNotificationResponse_ShouldEmitEvent { - (void)testDidReceiveNotificationResponse_ShouldEmitEvent {
UNNotification* notification = [self createNotificationWithIdentifier:@"id" andUserInfo:@{@"extraKey": @"extraValue"}]; 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() {}; void (^testBlock)(void) = ^void() {};
[[_mockedNotificationCenter expect] postNotificationName:RNNotificationOpened object:[OCMArg any] userInfo:[OCMArg checkWithBlock:^BOOL(id obj) { [[_mockedNotificationCenter expect] postNotificationName:RNNotificationOpened object:[OCMArg any] userInfo:[OCMArg checkWithBlock:^BOOL(id response) {
return ([[obj valueForKey:@"identifier"] isEqualToString:@"id"] && NSDictionary* notification = response[@"notification"];
[[obj valueForKey:@"extraKey"] isEqualToString:@"extraValue"]); NSDictionary* action = response[@"action"];
return ([[notification valueForKey:@"identifier"] isEqualToString:@"id"] &&
[[notification valueForKey:@"extraKey"] isEqualToString:@"extraValue"] && [action[@"identifier"] isEqualToString:@"actionId"]);
}]]; }]];
[_uut didReceiveNotificationResponse:response completionHandler:testBlock]; [_uut didReceiveNotificationResponse:response completionHandler:testBlock];
[_mockedNotificationCenter verify]; [_mockedNotificationCenter verify];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment