Skip to content

Commit

Permalink
test(objects): clean up code shouldn't affect mocked integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
parfeon committed Jun 26, 2024
1 parent 74c7af1 commit 20ec6b6
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions Tests/Tests/Helpers/PNRecordableTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -1464,12 +1464,14 @@ - (void)removeUUID:(NSString *)uuid membershipForChannels:(NSArray<NSString *> *
.uuid(uuid)
.channels(channels)
.performWithCompletion(^(PNManageMembershipsStatus *status) {
XCTAssertFalse(status.isError, @"Error reason: %@", status.errorData.information);
if (YHVVCR.cassette.isNewCassette) {
XCTAssertFalse(status.isError, @"Error reason: %@", status.errorData.information);

if (status.isError) {
NSLog(@"'%@' UUID MEMBERSHIP REMOVE ERROR: %@\n%@",
uuid, status.errorData.information,
[status valueForKey:@"clientRequest"]);
if (status.isError) {
NSLog(@"'%@' UUID MEMBERSHIP REMOVE ERROR: %@\n%@",
uuid, status.errorData.information,
[status valueForKey:@"clientRequest"]);
}
}

handler();
Expand Down Expand Up @@ -1501,14 +1503,16 @@ - (void)removeUUIDsMetadata:(NSArray<NSString *> *)uuids usingClient:(nullable P
client.objects().removeUUIDMetadata()
.uuid(uuid)
.performWithCompletion(^(PNAcknowledgmentStatus *status) {
XCTAssertFalse(status.isError, @"Error reason: %@", status.errorData.information);
if (YHVVCR.cassette.isNewCassette) {
XCTAssertFalse(status.isError, @"Error reason: %@", status.errorData.information);

if (status.isError) {
NSLog(@"'%@' UUID METADATA REMOVE ERROR: %@\n%@",
uuid, status.errorData.information,
[status valueForKey:@"clientRequest"]);
if (status.isError) {
NSLog(@"'%@' UUID METADATA REMOVE ERROR: %@\n%@",
uuid, status.errorData.information,
[status valueForKey:@"clientRequest"]);
}
}

handler();
});
}];
Expand Down Expand Up @@ -1758,14 +1762,16 @@ - (void)removeChannelsMetadata:(NSArray<NSString *> *)channels usingClient:(null
for (NSString *channel in channels) {
[self waitToCompleteIn:self.testCompletionDelay codeBlock:^(dispatch_block_t handler) {
client.objects().removeChannelMetadata(channel).performWithCompletion(^(PNAcknowledgmentStatus *status) {
XCTAssertFalse(status.isError, @"Error reason: %@", status.errorData.information);

if (status.isError) {
NSLog(@"'%@' CHANNEL METADATA REMOVE ERROR: %@\n%@",
channel, status.errorData.information,
[status valueForKey:@"clientRequest"]);
if (YHVVCR.cassette.isNewCassette) {
XCTAssertFalse(status.isError, @"Error reason: %@", status.errorData.information);

if (status.isError) {
NSLog(@"'%@' CHANNEL METADATA REMOVE ERROR: %@\n%@",
channel, status.errorData.information,
[status valueForKey:@"clientRequest"]);
}
}

handler();
});
}];
Expand Down

0 comments on commit 20ec6b6

Please sign in to comment.