mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Remove Robolectric, make Robolectric test an instrumentation test
This commit is contained in:
parent
ef82cc6aa7
commit
8d54a0d759
@ -168,7 +168,6 @@ ext.libs = [
|
||||
'kluent' : "org.amshove.kluent:kluent-android:1.68",
|
||||
'timberJunitRule' : "net.lachlanmckee:timber-junit-rule:1.0.1",
|
||||
'junit' : "junit:junit:4.13.2",
|
||||
'robolectric' : "org.robolectric:robolectric:4.8",
|
||||
]
|
||||
]
|
||||
|
||||
|
@ -210,7 +210,6 @@ ext.groups = [
|
||||
'org.ow2.asm',
|
||||
'org.ow2.asm',
|
||||
'org.reactivestreams',
|
||||
'org.robolectric',
|
||||
'org.slf4j',
|
||||
'org.sonatype.oss',
|
||||
'org.testng',
|
||||
|
@ -290,7 +290,6 @@ dependencies {
|
||||
testImplementation libs.tests.kluent
|
||||
testImplementation libs.mockk.mockk
|
||||
testImplementation libs.androidx.coreTesting
|
||||
testImplementation libs.tests.robolectric
|
||||
// Plant Timber tree for test
|
||||
testImplementation libs.tests.timberJunitRule
|
||||
testImplementation libs.airbnb.mavericksTesting
|
||||
|
@ -16,36 +16,26 @@
|
||||
|
||||
package im.vector.app.features
|
||||
|
||||
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
|
||||
import com.airbnb.mvrx.Success
|
||||
import com.airbnb.mvrx.test.MvRxTestRule
|
||||
import im.vector.app.core.epoxy.profiles.ProfileMatrixItemWithPowerLevelWithPresence
|
||||
import im.vector.app.core.utils.waitUntil
|
||||
import im.vector.app.features.roomprofile.members.RoomMemberListCategories
|
||||
import im.vector.app.features.roomprofile.members.RoomMemberListController
|
||||
import im.vector.app.features.roomprofile.members.RoomMemberListViewState
|
||||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.amshove.kluent.shouldBeEqualTo
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.matrix.android.sdk.api.session.crypto.model.UserVerificationLevel
|
||||
import org.matrix.android.sdk.api.session.room.model.Membership
|
||||
import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary
|
||||
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class RoomMemberListControllerTest {
|
||||
|
||||
@get:Rule
|
||||
val mvrxTestRule = MvRxTestRule()
|
||||
|
||||
@get:Rule
|
||||
val instantExecutorRule = InstantTaskExecutorRule()
|
||||
|
||||
@Test
|
||||
fun testControllerUserVerificationLevel() {
|
||||
fun testControllerUserVerificationLevel() = runTest {
|
||||
val roomListController = RoomMemberListController(
|
||||
avatarRenderer = mockk {
|
||||
},
|
||||
@ -109,6 +99,8 @@ class RoomMemberListControllerTest {
|
||||
|
||||
roomListController.setData(state)
|
||||
|
||||
waitUntil { !roomListController.hasPendingModelBuild() }
|
||||
|
||||
val models = roomListController.adapter.copyOfModels
|
||||
|
||||
val profileItems = models.filterIsInstance<ProfileMatrixItemWithPowerLevelWithPresence>()
|
Loading…
Reference in New Issue
Block a user