@@ -1997,46 +1997,5 @@ class UserTests: RPCBaseTests {
1997
1997
}
1998
1998
await fulfillment ( of: [ expectation] , timeout: 5 )
1999
1999
}
2000
-
2001
- func testFinalizePasskeyEnrollmentSuccess( ) throws {
2002
- setFakeGetAccountProvider ( )
2003
- let expectation = expectation ( description: #function)
2004
- signInWithEmailPasswordReturnFakeUser { user in
2005
- // Mock finalize backend
2006
- self . rpcIssuer. respondBlock = {
2007
- try self . rpcIssuer. respond (
2008
- withJSON: [
2009
- " idToken " : RPCBaseTests . kFakeAccessToken,
2010
- " refreshToken " : self . kRefreshToken,
2011
- ]
2012
- )
2013
- }
2014
- let credential = ASAuthorizationPlatformPublicKeyCredentialRegistration
2015
- user. finalizePasskeyEnrollment ( withPlatformCredential: credential) { error in
2016
- XCTAssertTrue ( Thread . isMainThread)
2017
- XCTAssertNil ( error)
2018
- expectation. fulfill ( )
2019
- }
2020
- }
2021
- waitForExpectations ( timeout: 5 )
2022
- }
2023
-
2024
- func testFinalizePasskeyEnrollmentFailure( ) throws {
2025
- setFakeGetAccountProvider ( )
2026
- let expectation = expectation ( description: #function)
2027
- signInWithEmailPasswordReturnFakeUser { user in
2028
- self . rpcIssuer. respondBlock = {
2029
- try self . rpcIssuer. respond ( serverErrorMessage: " OPERATION_NOT_ALLOWED " )
2030
- }
2031
- let credential = ASAuthorizationPlatformPublicKeyCredentialRegistration
2032
- user. finalizePasskeyEnrollment ( withPlatformCredential: credential) { error in
2033
- XCTAssertTrue ( Thread . isMainThread)
2034
- let nsError = try ! XCTUnwrap ( error as NSError ? )
2035
- XCTAssertEqual ( nsError. code, AuthErrorCode . operationNotAllowed. rawValue)
2036
- expectation. fulfill ( )
2037
- }
2038
- }
2039
- waitForExpectations ( timeout: 5 )
2040
- }
2041
2000
}
2042
2001
#endif
0 commit comments