Skip to content

Commit

Permalink
Workaround for mavericks bug (airbnb/mavericks#599).
Browse files Browse the repository at this point in the history
  • Loading branch information
onurays committed Jun 16, 2022
1 parent a1d35ae commit 14a4a8e
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import im.vector.app.test.fakes.FakeSession
import im.vector.app.test.test
import io.mockk.unmockkAll
import kotlinx.coroutines.delay
import kotlinx.coroutines.test.UnconfinedTestDispatcher
import kotlinx.coroutines.test.runTest
import org.amshove.kluent.shouldBe
import org.junit.After
Expand All @@ -47,7 +48,9 @@ import org.matrix.android.sdk.api.session.room.model.message.PollType
class CreatePollViewModelTest {

@get:Rule
val mvrxTestRule = MvRxTestRule()
val mvrxTestRule = MvRxTestRule(
testDispatcher = UnconfinedTestDispatcher() // See https://github.com/airbnb/mavericks/issues/599
)

private val fakeSession = FakeSession()

Expand Down Expand Up @@ -132,9 +135,8 @@ class CreatePollViewModelTest {
createPollViewModel.handle(CreatePollAction.OnOptionChanged(it, A_FAKE_OPTIONS[it]))
}

delay(10)
createPollViewModel
.test()
//delay(10)
createPollViewModel.test()
.assertState(pollViewStateWithQuestionAndEnoughOptions)
.finish()
}
Expand Down

0 comments on commit 14a4a8e

Please sign in to comment.