Skip to content

Commit 53a749a

Browse files
authored
chore(auth): Fix problem of global signout tests causing failures in other tests (#3144)
1 parent cade307 commit 53a749a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

aws-auth-cognito/src/androidTest/java/com/amplifyframework/auth/cognito/AuthCanaryTest.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,10 @@ class AuthCanaryTest {
246246

247247
@Test
248248
fun globalSignOut() {
249-
signInUser(username, password)
249+
signUpUser(tempUsername, tempPassword)
250+
confirmTemporaryUserSignUp(tempUsername)
251+
signInUser(tempUsername, tempPassword)
252+
250253
val options = AuthSignOutOptions.builder()
251254
.globalSignOut(true)
252255
.build()
@@ -279,6 +282,7 @@ class AuthCanaryTest {
279282
.userAttribute(AuthUserAttributeKey.email(), "[email protected]")
280283
.build()
281284
syncAuth.signUp(user, pass, options)
285+
signedUpNewUser = true
282286
}
283287

284288
private fun signInUser(user: String, pass: String) {

aws-auth-cognito/src/androidTest/java/com/amplifyframework/auth/cognito/AuthCanaryTestGen2.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,10 @@ class AuthCanaryTestGen2 {
253253

254254
@Test
255255
fun globalSignOut() {
256-
signInUser(username, password)
256+
signUpUser(tempUsername, tempPassword)
257+
confirmTemporaryUserSignUp(tempUsername)
258+
signInUser(tempUsername, tempPassword)
259+
257260
val options = AuthSignOutOptions.builder()
258261
.globalSignOut(true)
259262
.build()
@@ -286,6 +289,7 @@ class AuthCanaryTestGen2 {
286289
.userAttribute(AuthUserAttributeKey.email(), "[email protected]")
287290
.build()
288291
syncAuth.signUp(user, pass, options)
292+
signedUpNewUser = true
289293
}
290294

291295
private fun signInUser(user: String, pass: String) {

0 commit comments

Comments
 (0)