1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-11 10:18:05 +09:00

Fix/broken toggle after turn-into in multi select mode (#686)

This commit is contained in:
Evgenii Kozlov 2020-08-18 17:20:08 +02:00 committed by GitHub
parent 9985314ca3
commit e6cf3f4a1a
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 119 additions and 20 deletions

View file

@ -5,8 +5,9 @@ import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.agileburo.anytype.domain.block.model.Block
import com.agileburo.anytype.domain.event.interactor.InterceptEvents
import com.agileburo.anytype.presentation.util.CoroutinesTestRule
import com.nhaarman.mockitokotlin2.*
import kotlinx.coroutines.flow.flowOf
import com.nhaarman.mockitokotlin2.times
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitokotlin2.verifyZeroInteractions
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@ -52,14 +53,10 @@ class EditorEventSubscriptionTest : EditorPresentationTestSetup() {
val document = listOf(page, a)
stubOpenDocument(document = document)
stubObserveEvents()
val params = InterceptEvents.Params(context = root)
interceptEvents.stub {
onBlocking { build(params) } doReturn flowOf()
}
stubOpenDocument(document = document)
stubInterceptEvents(params)
val vm = buildViewModel()

View file

@ -228,6 +228,15 @@ open class EditorPresentationTestSetup {
interceptEvents.stub { onBlocking { build() } doReturn flow }
}
fun stubInterceptEvents(
params: InterceptEvents.Params = InterceptEvents.Params(context = root),
flow: Flow<List<Event>> = flowOf()
) {
interceptEvents.stub {
onBlocking { build(params) } doReturn flow
}
}
fun stubUpdateTextStyle(
params: UpdateTextStyle.Params? = null,
events: List<Event> = emptyList()