Skip to content

Commit

Permalink
Fix FB Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
morganchen12 committed Jan 29, 2021
1 parent 30e75fb commit 58cc2a9
Showing 1 changed file with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ - (void)testSuccessfullLogin {
id mockToken = OCMPartialMock(token);

NSSet *emptySet = [NSSet set];
FBSDKLoginManagerLoginResult *result = [[FBSDKLoginManagerLoginResult alloc] initWithToken:mockToken
isCancelled:NO
grantedPermissions:emptySet
declinedPermissions:emptySet];
FBSDKLoginManagerLoginResult *result =
[[FBSDKLoginManagerLoginResult alloc] initWithToken:mockToken
authenticationToken:nil
isCancelled:NO
grantedPermissions:emptySet
declinedPermissions:emptySet];
XCTAssertNil(_provider.accessToken);
[self.provider configureLoginManager:result withError:nil];

Expand Down Expand Up @@ -156,10 +158,12 @@ - (void)testLegacyInitSuccessfulLogin {
id mockToken = OCMPartialMock(token);

NSSet *emptySet = [NSSet set];
FBSDKLoginManagerLoginResult *result = [[FBSDKLoginManagerLoginResult alloc] initWithToken:mockToken
isCancelled:NO
grantedPermissions:emptySet
declinedPermissions:emptySet];
FBSDKLoginManagerLoginResult *result =
[[FBSDKLoginManagerLoginResult alloc] initWithToken:mockToken
authenticationToken:nil
isCancelled:NO
grantedPermissions:emptySet
declinedPermissions:emptySet];
XCTAssertNil(_provider.accessToken);
[self.provider configureLoginManager:result withError:nil];

Expand Down Expand Up @@ -202,10 +206,12 @@ - (void)testCancelLogin {
refreshDate:nil
dataAccessExpirationDate:nil];
id mockToken = OCMPartialMock(token);
FBSDKLoginManagerLoginResult *result = [[FBSDKLoginManagerLoginResult alloc] initWithToken:mockToken
isCancelled:YES
grantedPermissions:[NSSet set]
declinedPermissions:[NSSet set]];
FBSDKLoginManagerLoginResult *result =
[[FBSDKLoginManagerLoginResult alloc] initWithToken:mockToken
authenticationToken:nil
isCancelled:YES
grantedPermissions:[NSSet set]
declinedPermissions:[NSSet set]];
[self.provider configureLoginManager:result withError:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"logged in"];
Expand Down

0 comments on commit 58cc2a9

Please sign in to comment.