Skip to content

Commit

Permalink
Updated shortUrl test
Browse files Browse the repository at this point in the history
  • Loading branch information
nsingh-branch committed Oct 23, 2023
1 parent 70d3d39 commit f4946f5
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions Branch-TestBed/Branch-SDK-Tests/BranchClassTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,23 +200,10 @@ - (void)testGetLatestReferringBranchLinkProperties_ClickedBranchLink {
XCTAssertEqualObjects(result.campaign, @"latest campaign");
}

- (void)testGetShortURL {
XCTestExpectation *expectation = [self expectationWithDescription:@"Fetching URL"];

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSString *shortURL = [self.branch getShortURL];

XCTAssertNotNil(shortURL, @"URL should not be nil");
XCTAssertTrue([shortURL hasPrefix:@"https://"], @"URL should start with 'https://'");

[expectation fulfill];
});

[self waitForExpectationsWithTimeout:10 handler:^(NSError *error) {
if (error) {
NSLog(@"Timeout Error: %@", error);
}
}];
- (void)testGetShortURL {
NSString *shortURL = [self.branch getShortURL];
XCTAssertNotNil(shortURL, @"URL should not be nil");
XCTAssertTrue([shortURL hasPrefix:@"https://"], @"URL should start with 'https://'");
}

- (void)testGetLongURLWithParamsAndChannelAndTagsAndFeatureAndStageAndAlias {
Expand Down

0 comments on commit f4946f5

Please sign in to comment.