Skip to content

Commit 6a21cf5

Browse files
authored
Remove duplicated test, use proper name for test and skip test for macOS (#2362)
1 parent 254dc5d commit 6a21cf5

File tree

1 file changed

+2
-34
lines changed

1 file changed

+2
-34
lines changed

MSAL/test/integration/native_auth/end_to_end/credentials/MSALNativeAuthUserAccountEndToEndTests.swift

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ final class MSALNativeAuthUserAccountEndToEndTests: MSALNativeAuthEndToEndPasswo
6262
XCTAssertEqual(signInDelegateSpy.result?.account.username, username)
6363
}
6464

65-
// Sign in with username and password to get access token and force refresh with existing scopes
66-
func test_signInAndForceRefreshWithExistingScopesSucceeds() async throws {
65+
// Sign in with username and password to get access token and force refresh with access token not linked to client Id
66+
func test_signInAndForceRefreshWithNotConfiguredScopes() async throws {
6767
#if os(macOS)
6868
throw XCTSkip("Bundle id for macOS is not added to the client id, test is not needed on both iOS and macOS")
6969
#endif
@@ -83,38 +83,6 @@ final class MSALNativeAuthUserAccountEndToEndTests: MSALNativeAuthEndToEndPasswo
8383
XCTAssertNotNil(signInDelegateSpy.result?.idToken)
8484
XCTAssertEqual(signInDelegateSpy.result?.account.username, username)
8585

86-
let previousIdToken = signInDelegateSpy.result?.idToken
87-
let refreshAccessTokenExpectation = expectation(description: "refreshing access token")
88-
let credentialsDelegateSpy = CredentialsDelegateSpy(expectation: refreshAccessTokenExpectation)
89-
90-
signInDelegateSpy.result?.getAccessToken(scopes: ["User.Read"], forceRefresh: true, delegate: credentialsDelegateSpy)
91-
92-
await fulfillment(of: [refreshAccessTokenExpectation])
93-
94-
XCTAssertTrue(credentialsDelegateSpy.onAccessTokenRetrieveCompletedCalled)
95-
XCTAssertNotNil(credentialsDelegateSpy.result?.accessToken)
96-
XCTAssertNotEqual(previousIdToken, signInDelegateSpy.result?.idToken)
97-
XCTAssertEqual(signInDelegateSpy.result?.account.username, username)
98-
}
99-
100-
// Sign in with username and password to get access token and force refresh with different scopes
101-
func test_signInAndForceRefreshWithDifferentScopesFails() async throws {
102-
guard let sut = initialisePublicClientApplication(), let username = retrieveUsernameForSignInUsernameAndPassword(), let password = await retrievePasswordForSignInUsername() else {
103-
XCTFail("Missing information")
104-
return
105-
}
106-
107-
let signInExpectation = expectation(description: "signing in")
108-
let signInDelegateSpy = SignInPasswordStartDelegateSpy(expectation: signInExpectation)
109-
110-
sut.signIn(username: username, password: password, correlationId: correlationId, delegate: signInDelegateSpy)
111-
112-
await fulfillment(of: [signInExpectation])
113-
114-
XCTAssertTrue(signInDelegateSpy.onSignInCompletedCalled)
115-
XCTAssertNotNil(signInDelegateSpy.result?.idToken)
116-
XCTAssertEqual(signInDelegateSpy.result?.account.username, username)
117-
11886
let refreshAccessTokenExpectation = expectation(description: "refreshing access token")
11987
let credentialsDelegateSpy = CredentialsDelegateSpy(expectation: refreshAccessTokenExpectation)
12088

0 commit comments

Comments
 (0)