// // Copyright Amazon.com Inc. or its affiliates. // All Rights Reserved. // // SPDX-License-Identifier: Apache-2.0 // import XCTest @testable import Amplify import AWSCognitoAuthPlugin class AuthSignUpTests: AWSAuthBaseTest { /// Test if user registration is successful. /// /// - Given: A username that is not present in the system /// - When: /// - I invoke Amplify.Auth.signUp with the username and a random password /// - Then: /// - I should get a signup complete step. /// func testSuccessfulRegisterUser() async throws { let username = "integTest\(UUID().uuidString)" let password = "P123@\(UUID().uuidString)" let options = AuthSignUpRequest.Options(userAttributes: [ AuthUserAttribute(.email, value: defaultTestEmail)]) let signUpResult = try await Amplify.Auth.signUp(username: username, password: password, options: options) XCTAssertTrue(signUpResult.isSignUpComplete, "Signup should be complete") } func testMultipleSignUps() async throws { let signUpExpectation = expectation(description: "Sign up completed") signUpExpectation.expectedFulfillmentCount = 2 for _ in 0..