forked from dsutanto/bChot-android
refactoring to id.databisnis.bachot
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
plugins {
|
||||
id("io.element.android-compose-library")
|
||||
id("id.databisnis.android.bachot-compose-library")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "io.element.android.tests.testutils"
|
||||
namespace = "id.databisnis.android.bachot.tests.testutils"
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
|
||||
+2
-2
@@ -6,9 +6,9 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import io.element.android.libraries.androidutils.metadata.isInDebug
|
||||
import id.databisnis.android.bachot.libraries.androidutils.metadata.isInDebug
|
||||
import org.junit.Assert.assertThrows
|
||||
|
||||
/**
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
class EnsureCalledOnce : () -> Unit {
|
||||
private var counter = 0
|
||||
+2
-2
@@ -6,9 +6,9 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import io.element.android.tests.testutils.lambda.lambdaError
|
||||
import id.databisnis.android.bachot.tests.testutils.lambda.lambdaError
|
||||
|
||||
class EnsureNeverCalled : () -> Unit {
|
||||
override fun invoke() {
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
|
||||
+2
-2
@@ -6,10 +6,10 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import io.element.android.services.toolbox.api.strings.StringProvider
|
||||
import id.databisnis.android.bachot.services.toolbox.api.strings.StringProvider
|
||||
|
||||
class InstrumentationStringProvider : StringProvider {
|
||||
private val resource = InstrumentationRegistry.getInstrumentation().context.resources
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import kotlinx.coroutines.TimeoutCancellationException
|
||||
+2
-2
@@ -6,11 +6,11 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import io.element.android.libraries.architecture.Presenter
|
||||
import id.databisnis.android.bachot.libraries.architecture.Presenter
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
|
||||
class MutablePresenter<State>(initialState: State) : Presenter<State> {
|
||||
+2
-2
@@ -6,13 +6,13 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import app.cash.molecule.RecompositionMode
|
||||
import app.cash.molecule.moleculeFlow
|
||||
import app.cash.turbine.TurbineTestContext
|
||||
import app.cash.turbine.test
|
||||
import io.element.android.libraries.architecture.Presenter
|
||||
import id.databisnis.android.bachot.libraries.architecture.Presenter
|
||||
import org.junit.Assert.fail
|
||||
import kotlin.time.Duration
|
||||
|
||||
+2
-2
@@ -6,12 +6,12 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import app.cash.turbine.Event
|
||||
import app.cash.turbine.ReceiveTurbine
|
||||
import app.cash.turbine.withTurbineTimeout
|
||||
import io.element.android.libraries.core.bool.orFalse
|
||||
import id.databisnis.android.bachot.libraries.core.bool.orFalse
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
+2
-2
@@ -6,13 +6,13 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.ui.test.junit4.AndroidComposeTestRule
|
||||
import io.element.android.libraries.designsystem.utils.LocalUiTestMode
|
||||
import id.databisnis.android.bachot.libraries.designsystem.utils.LocalUiTestMode
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.rules.TestRule
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.annotation.StringRes
|
||||
@@ -19,7 +19,7 @@ import androidx.compose.ui.test.junit4.AndroidComposeTestRule
|
||||
import androidx.compose.ui.test.onFirst
|
||||
import androidx.compose.ui.test.onNodeWithText
|
||||
import androidx.compose.ui.test.performClick
|
||||
import io.element.android.libraries.ui.strings.CommonStrings
|
||||
import id.databisnis.android.bachot.libraries.ui.strings.CommonStrings
|
||||
import org.junit.rules.TestRule
|
||||
|
||||
fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.clickOn(@StringRes res: Int) {
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.runtime.Composable
|
||||
+2
-2
@@ -8,9 +8,9 @@
|
||||
|
||||
@file:OptIn(ExperimentalCoroutinesApi::class)
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
|
||||
import id.databisnis.android.bachot.libraries.core.coroutine.CoroutineDispatchers
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.test.StandardTestDispatcher
|
||||
import kotlinx.coroutines.test.TestScope
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import timber.log.Timber
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import kotlinx.coroutines.delay
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import app.cash.molecule.RecompositionMode
|
||||
import app.cash.molecule.moleculeFlow
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils
|
||||
package id.databisnis.android.bachot.tests.testutils
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -21,7 +21,7 @@ import app.cash.molecule.RecompositionMode
|
||||
import app.cash.molecule.moleculeFlow
|
||||
import app.cash.turbine.TurbineTestContext
|
||||
import app.cash.turbine.test
|
||||
import io.element.android.libraries.architecture.Presenter
|
||||
import id.databisnis.android.bachot.libraries.architecture.Presenter
|
||||
|
||||
/**
|
||||
* Composable that provides a fake [LifecycleOwner] to the composition.
|
||||
+3
-3
@@ -6,11 +6,11 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils.fake
|
||||
package id.databisnis.android.bachot.tests.testutils.fake
|
||||
|
||||
import android.net.Uri
|
||||
import io.element.android.libraries.androidutils.file.TemporaryUriDeleter
|
||||
import io.element.android.tests.testutils.lambda.lambdaError
|
||||
import id.databisnis.android.bachot.libraries.androidutils.file.TemporaryUriDeleter
|
||||
import id.databisnis.android.bachot.tests.testutils.lambda.lambdaError
|
||||
|
||||
class FakeTemporaryUriDeleter(
|
||||
val deleteLambda: (uri: Uri?) -> Unit = { lambdaError() }
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils.lambda
|
||||
package id.databisnis.android.bachot.tests.testutils.lambda
|
||||
|
||||
fun assert(lambdaRecorder: LambdaRecorder): LambdaRecorderAssertions {
|
||||
return lambdaRecorder.assertions()
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils.lambda
|
||||
package id.databisnis.android.bachot.tests.testutils.lambda
|
||||
|
||||
fun lambdaError(
|
||||
message: String = "This lambda should never be called."
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils.lambda
|
||||
package id.databisnis.android.bachot.tests.testutils.lambda
|
||||
|
||||
/**
|
||||
* A recorder that can be used to record the parameters of lambda invocation.
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils.lambda
|
||||
package id.databisnis.android.bachot.tests.testutils.lambda
|
||||
|
||||
/**
|
||||
* A matcher that can be used to match parameters in lambda calls.
|
||||
+4
-4
@@ -6,15 +6,15 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.tests.testutils.node
|
||||
package id.databisnis.android.bachot.tests.testutils.node
|
||||
|
||||
import com.bumble.appyx.core.modality.BuildContext
|
||||
import com.bumble.appyx.core.node.EmptyNodeView
|
||||
import com.bumble.appyx.core.node.Node
|
||||
import com.bumble.appyx.core.plugin.Plugin
|
||||
import io.element.android.libraries.architecture.AssistedNodeFactory
|
||||
import io.element.android.libraries.architecture.NodeFactoriesBindings
|
||||
import io.element.android.libraries.di.DependencyInjectionGraphOwner
|
||||
import id.databisnis.android.bachot.libraries.architecture.AssistedNodeFactory
|
||||
import id.databisnis.android.bachot.libraries.architecture.NodeFactoriesBindings
|
||||
import id.databisnis.android.bachot.libraries.di.DependencyInjectionGraphOwner
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
/**
|
||||
Reference in New Issue
Block a user