Skip to content

Commit

Permalink
chore(): Updated iOS fetchAuthSession unit test to support Result
Browse files Browse the repository at this point in the history
  • Loading branch information
tyllark committed Feb 17, 2025
1 parent 962a76b commit 021aa25
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ class NativeAuthPluginTests: XCTestCase {
let binaryMessenger = MockBinaryMessenger(isSignedIn: isSignedIn)
let nativePlugin = NativeAuthPlugin(binaryMessenger: binaryMessenger)
let expectation = expectation(description: "fetchAuthSession completes")
nativePlugin.fetchAuthSession { session in
defer { expectation.fulfill() }
XCTAssertNotNil(session)
XCTAssertEqual(session.isSignedIn, isSignedIn)
nativePlugin.fetchAuthSession { result in
switch result {
case .success(let session):
defer { expectation.fulfill() }
assertSession(session, isSignedIn)
case .failure(let error):
XCTFail("fetchAuthSession failed with error: \(error)")
}
}
waitForExpectations(timeout: 1)
}
Expand Down

0 comments on commit 021aa25

Please sign in to comment.