Create Fake classes in test modules

This commit is contained in:
Benoit Marty 2025-10-30 18:32:31 +01:00
parent 0303ac502a
commit 187479849d
62 changed files with 798 additions and 327 deletions

View file

@ -9,11 +9,9 @@ package io.element.android.features.poll.impl.history
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.features.poll.api.create.CreatePollEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
import io.element.android.features.poll.test.create.FakeCreatePollEntryPoint
import io.element.android.tests.testutils.node.TestParentNode
import kotlinx.coroutines.test.runTest
import org.junit.Rule
@ -33,13 +31,7 @@ class DefaultPollHistoryEntryPointTest {
PollHistoryFlowNode(
buildContext = buildContext,
plugins = plugins,
createPollEntryPoint = object : CreatePollEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: CreatePollEntryPoint.Params,
) = lambdaError()
}
createPollEntryPoint = FakeCreatePollEntryPoint(),
)
}
val result = with(parentNode) {