Skip to content

Commit

Permalink
feat: changed from launch to launchActivityForResult in a ReleaseNote…
Browse files Browse the repository at this point in the history
…sActivityTest, LoginActivityTest and PassCodeActivityTest
  • Loading branch information
Aitorbp committed Apr 5, 2024
1 parent 036229d commit 181b7aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @author Abel García de Prada
* @author Juan Carlos Garrote Gascón
* @author Jorge Aguado Recio
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2024 ownCloud GmbH.
*
Expand Down Expand Up @@ -193,9 +194,9 @@ class LoginActivityTest {
every { ocContextProvider.getString(R.string.app_name) } returns BRANDED_APP_NAME

activityScenario = if (intent == null) {
ActivityScenario.launch(LoginActivity::class.java)
ActivityScenario.launchActivityForResult(LoginActivity::class.java)
} else {
ActivityScenario.launch(intent)
ActivityScenario.launchActivityForResult(intent)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
* @author Christian Schabesberger (@theScrabi)
* @author Juan Carlos Garrote Gascón (@JuancaG05)
* @author David Crespo Ríos (@davcres)
* @author Aitor Ballesteros Pavón (@Aitorbp)
*
* Copyright (C) 2021 ownCloud GmbH.
* Copyright (C) 2024 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -38,12 +39,12 @@ import androidx.test.espresso.matcher.ViewMatchers.withText
import com.owncloud.android.R
import com.owncloud.android.db.PreferenceManager
import com.owncloud.android.domain.utils.Event
import com.owncloud.android.presentation.security.biometric.BiometricViewModel
import com.owncloud.android.presentation.security.passcode.PassCodeActivity
import com.owncloud.android.presentation.security.passcode.PassCodeViewModel
import com.owncloud.android.presentation.security.passcode.PasscodeAction
import com.owncloud.android.presentation.security.passcode.PasscodeType
import com.owncloud.android.presentation.security.passcode.Status
import com.owncloud.android.presentation.security.biometric.BiometricViewModel
import com.owncloud.android.presentation.security.passcode.PassCodeViewModel
import com.owncloud.android.testutil.security.OC_PASSCODE_4_DIGITS
import com.owncloud.android.utils.matchers.isDisplayed
import com.owncloud.android.utils.matchers.withChildCountAndId
Expand Down Expand Up @@ -352,6 +353,6 @@ class PassCodeActivityTest {
val intent = Intent(context, PassCodeActivity::class.java).apply {
action = mode
}
activityScenario = ActivityScenario.launch(intent)
activityScenario = ActivityScenario.launchActivityForResult(intent)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
* ownCloud Android client application
*
* @author David Crespo Ríos
* Copyright (C) 2022 ownCloud GmbH.
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2024 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -70,7 +72,7 @@ class ReleaseNotesActivityTest {
every { releaseNotesViewModel.getReleaseNotes() } returns releaseNotesList

val intent = Intent(context, ReleaseNotesActivity::class.java)
activityScenario = ActivityScenario.launch(intent)
activityScenario = ActivityScenario.launchActivityForResult(intent)
}

@Test
Expand Down

0 comments on commit 181b7aa

Please sign in to comment.