Skip to content

Commit

Permalink
fix: remove integTest.com
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh62 committed Oct 30, 2024
1 parent f332d12 commit b5d7595
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ import XCTest
@_spi(InternalAmplifyConfiguration) @testable import Amplify
import AWSCognitoAuthPlugin

fileprivate let internalTestDomain = "@amplify-swift-gamma.awsapps.com"

class AWSAuthBaseTest: XCTestCase {

let networkTimeout = TimeInterval(5)

var defaultTestEmail = "test-\(UUID().uuidString)@amazon.com"
var defaultTestEmail = "test-\(UUID().uuidString)\(internalTestDomain)"
var defaultTestPassword = UUID().uuidString

var randomEmail: String {
"test-\(UUID().uuidString)@amazon.com"
"test-\(UUID().uuidString)\(internalTestDomain)"
}

var randomPhoneNumber: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class EmailMFARequiredTests: AWSAuthBaseTest {

// Step 5: Provide the email address to complete MFA setup
var confirmSignInResult = try await Amplify.Auth.confirmSignIn(
challengeResponse: username + "@integTest.com")
challengeResponse: defaultTestEmail)

// Step 6: Ensure that the next step is to confirm the Email MFA code
guard case .confirmSignInWithOTP(let deliveryDetails) = confirmSignInResult.nextStep else {
Expand Down Expand Up @@ -121,7 +121,7 @@ class EmailMFARequiredTests: AWSAuthBaseTest {

// Step 9: Verify that the email is associated with the user account
let attributes = try await Amplify.Auth.fetchUserAttributes()
XCTAssertEqual(attributes.first(where: { $0.key == .email })?.value, username + "@integTest.com")
XCTAssertEqual(attributes.first(where: { $0.key == .email })?.value, defaultTestEmail)
} catch {
XCTFail("Unexpected error: \(error)")
}
Expand Down Expand Up @@ -154,7 +154,7 @@ class EmailMFARequiredTests: AWSAuthBaseTest {
_ = try await AuthSignInHelper.signUpUserReturningResult(
username: username,
password: password,
email: username + "@integTest.com")
email: defaultTestEmail)

let options = AuthSignInRequest.Options()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class EmailMFAWithAllMFATypesRequiredTests: AWSAuthBaseTest {
// Step 1: Set up a subscription to receive MFA codes
createMFASubscription()
let uniqueId = UUID().uuidString
let username = "\(uniqueId)@integTest.com"
let username = randomEmail
let password = "Pp123@\(uniqueId)"

// Step 2: Sign up a new user with email
Expand Down Expand Up @@ -190,7 +190,7 @@ class EmailMFAWithAllMFATypesRequiredTests: AWSAuthBaseTest {

// Step 7: Provide the email address to complete the setup
confirmSignInResult = try await Amplify.Auth.confirmSignIn(
challengeResponse: username + "@integTest.com")
challengeResponse: defaultTestEmail)

// Step 8: Verify that the next step is to confirm the Email MFA code
guard case .confirmSignInWithOTP(let deliveryDetails) = confirmSignInResult.nextStep else {
Expand Down

0 comments on commit b5d7595

Please sign in to comment.