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:
parent
9985314ca3
commit
e6cf3f4a1a
6 changed files with 119 additions and 20 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue