Skip to content

Commit

Permalink
add signInCustomDomain2InSuccess and skip
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki-YuXin committed Dec 12, 2024
1 parent faa59c5 commit 886d1fe
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,35 @@ final class MSALNativeAuthSignInUsernameAndPasswordEndToEndTests: MSALNativeAuth
}
}

// Sign In - Verify Custom URL Domain - "https://<tenantName>.ciamlogin.com/<tenantId>"
func test_signInCustomDomain1InSuccess() async throws {
throw XCTSkip("Skipping test as it requires a tenantId, not present in MSIDLAB config file")

guard let sut = initialisePublicClientApplication(customSubdomainFormat: 1) else {
XCTFail("Failed to initialise auth client")
return
}

guard let username = retrieveUsernameForSignInUsernameAndPassword(),
let password = await retrievePasswordForSignInUsername() else {
XCTFail("Missing username or password")
return
}

let signInExpectation = expectation(description: "Signing in")
let signInDelegateSpy = SignInPasswordStartDelegateSpy(expectation: signInExpectation)

// Perform the sign-in asynchronously
Task {
await sut.signIn(username: username, password: password, correlationId: correlationId, delegate: signInDelegateSpy)
await fulfillment(of: [signInExpectation])

XCTAssertTrue(signInDelegateSpy.onSignInCompletedCalled)
XCTAssertNotNil(signInDelegateSpy.result?.idToken)
XCTAssertEqual(signInDelegateSpy.result?.account.username, username)
}
}

// Sign In - Verify Custom URL Domain - "https://<tenantName>.ciamlogin.com/"
func test_signInCustomDomain3InSuccess() async throws {
guard let sut = initialisePublicClientApplication(customSubdomainFormat: 2) else {
Expand Down

0 comments on commit 886d1fe

Please sign in to comment.