@@ -66,14 +66,13 @@ - (void) testSetIdentity {
6666 NSString *const kUserIdentity = @" Nada" ;
6767 Branch*branch = self.branch ;
6868 XCTestExpectation *expectation = [self expectationWithDescription: @" testSetIdentity" ];
69- [branch setUserIdentity: kUserIdentity
70- completion: ^ (BranchSession * _Nullable session, NSError * _Nullable error) {
69+ [branch setUserIdentity: kUserIdentity completion: ^ (BranchSession * _Nullable session, NSError * _Nullable error) {
7170 XCTAssertNil (error);
7271 XCTAssertEqualObjects (session.userIdentityForDeveloper , kUserIdentity );
7372 [expectation fulfill ];
7473 }
7574 ];
76- [self waitForExpectationsWithTimeout: 5.0 handler: nil ];
75+ [self waitForExpectationsWithTimeout: 0.1 handler: nil ];
7776 XCTAssertTrue (branch.userIdentityIsSet );
7877
7978 [self resetExpectations ];
@@ -82,7 +81,7 @@ - (void) testSetIdentity {
8281 XCTAssertNil (error);
8382 [expectation fulfill ];
8483 }];
85- [self waitForExpectationsWithTimeout: 5.0 handler: nil ];
84+ [self waitForExpectationsWithTimeout: 0.1 handler: nil ];
8685 XCTAssertFalse (branch.userIdentityIsSet );
8786}
8887
@@ -102,7 +101,7 @@ - (void)testGetUserIdentityEmail {
102101 XCTAssertEqualObjects (session.userIdentityForDeveloper , userIdentity);
103102 [expectation fulfill ];
104103 }];
105- [self waitForExpectationsWithTimeout: 5.0 handler: nil ];
104+ [self waitForExpectationsWithTimeout: 0.1 handler: nil ];
106105 XCTAssertTrue (branch.userIdentityIsSet );
107106 XCTAssertTrue ([userIdentity isEqualToString: [branch getUserIdentity ]]);
108107}
@@ -149,13 +148,14 @@ - (void) testShortLinksWithoutBUO1 {
149148 NSString *channel = @" facebook" ;
150149 NSString *feature = @" sharing" ;
151150 NSArray *tags = @[ @" t1" , @" t2" ];
152- NSString *alias = @" testAlias " ;
153-
151+ NSString *alias = [ NSString stringWithFormat: @" testAlias_ %@ " , [ NSUUID UUID ].UUIDString] ;
152+
154153 XCTestExpectation *expectation = [self expectationWithDescription: @" testShortLinksWithoutBUO" ];
155154 [self .branch branchShortUrlWithParams: ( NSDictionary * _Nullable )params andChannel: ( NSString * _Nullable )channel andFeature: (NSString * _Nullable)feature andTags: (NSArray * _Nullable)tags andAlias: (NSString * _Nullable)alias andCallback: ^ (NSURL * _Nullable shortURL, NSError * _Nullable error) {
156155 XCTAssertNil (error);
157156 XCTAssertNotNil (shortURL);
158- XCTAssertTrue ([shortURL.absoluteString isEqualToString: @" https://testbed-mac.app.link/testAlias" ]);
157+ NSString *expectedURL = [NSString stringWithFormat: @" https://testbed-mac.app.link/%@ " , alias];
158+ XCTAssertTrue ([shortURL.absoluteString isEqualToString: expectedURL]);
159159 [expectation fulfill ];
160160 }];
161161 [self waitForExpectationsWithTimeout: 5.0 handler: nil ];
@@ -167,13 +167,14 @@ - (void) testShortLinksWithoutBUO2 {
167167 NSString *channel = @" facebook" ;
168168 NSString *feature = @" sharing" ;
169169 NSArray *tags = @[ @" t1" , @" t2" ];
170- NSString *alias = @" testAlias " ;
171-
170+ NSString *alias = [ NSString stringWithFormat: @" testAlias_ %@ " , [ NSUUID UUID ].UUIDString] ;
171+
172172 XCTestExpectation *expectation = [self expectationWithDescription: @" testShortLinksWithoutBUO" ];
173173 [self .branch branchShortUrlWithParams: ( NSDictionary * _Nullable )params andChannel: ( NSString * _Nullable )channel andFeature: (NSString * _Nullable)feature andTags: (NSArray * _Nullable)tags andAlias: (NSString * _Nullable)alias andCallback: ^ (NSURL * _Nullable shortURL, NSError * _Nullable error) {
174174 XCTAssertNil (error);
175175 XCTAssertNotNil (shortURL);
176- XCTAssertTrue ([shortURL.absoluteString isEqualToString: @" https://testbed-mac.app.link/testAlias" ]);
176+ NSString *expectedURL = [NSString stringWithFormat: @" https://testbed-mac.app.link/%@ " , alias];
177+ XCTAssertTrue ([shortURL.absoluteString isEqualToString: expectedURL]);
177178 [expectation fulfill ];
178179 }];
179180 [self waitForExpectationsWithTimeout: 5.0 handler: nil ];
0 commit comments