Restore disabled tests with FFI fakes
This commit is contained in:
parent
198f3f2a0b
commit
e814906ba1
24 changed files with 49 additions and 136 deletions
|
|
@ -23,11 +23,9 @@ import io.element.android.services.toolbox.test.systemclock.FakeSystemClock
|
||||||
import io.element.android.tests.testutils.testCoroutineDispatchers
|
import io.element.android.tests.testutils.testCoroutineDispatchers
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class RustMatrixClientFactoryTest {
|
class RustMatrixClientFactoryTest {
|
||||||
@Test
|
@Test
|
||||||
fun test() = runTest {
|
fun test() = runTest {
|
||||||
|
|
|
||||||
|
|
@ -31,13 +31,11 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.advanceUntilIdle
|
import kotlinx.coroutines.test.advanceUntilIdle
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.Client
|
import org.matrix.rustcomponents.sdk.Client
|
||||||
import org.matrix.rustcomponents.sdk.UserProfile
|
import org.matrix.rustcomponents.sdk.UserProfile
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class RustMatrixClientTest {
|
class RustMatrixClientTest {
|
||||||
@Test
|
@Test
|
||||||
fun `ensure that sessionId and deviceId can be retrieved from the client`() = runTest {
|
fun `ensure that sessionId and deviceId can be retrieved from the client`() = runTest {
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,8 @@ package io.element.android.libraries.matrix.impl.auth
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import io.element.android.libraries.matrix.api.auth.MatrixHomeServerDetails
|
import io.element.android.libraries.matrix.api.auth.MatrixHomeServerDetails
|
||||||
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiHomeserverLoginDetails
|
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiHomeserverLoginDetails
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class HomeserverDetailsKtTest {
|
class HomeserverDetailsKtTest {
|
||||||
@Test
|
@Test
|
||||||
fun `map should be correct`() {
|
fun `map should be correct`() {
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,8 @@ import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiClient
|
||||||
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiClientBuilder
|
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiClientBuilder
|
||||||
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiHomeserverLoginDetails
|
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiHomeserverLoginDetails
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class RustHomeserverLoginCompatibilityCheckerTest {
|
class RustHomeserverLoginCompatibilityCheckerTest {
|
||||||
@Test
|
@Test
|
||||||
fun `check - is valid if it supports OIDC login`() = runTest {
|
fun `check - is valid if it supports OIDC login`() = runTest {
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,10 @@ import io.element.android.libraries.sessionstorage.test.InMemorySessionStore
|
||||||
import io.element.android.tests.testutils.testCoroutineDispatchers
|
import io.element.android.tests.testutils.testCoroutineDispatchers
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
class RustMatrixAuthenticationServiceTest {
|
class RustMatrixAuthenticationServiceTest {
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `setHomeserver is successful`() = runTest {
|
fun `setHomeserver is successful`() = runTest {
|
||||||
val sut = createRustMatrixAuthenticationService(
|
val sut = createRustMatrixAuthenticationService(
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,8 @@ package io.element.android.libraries.matrix.impl.auth.qrlogin
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiQrCodeData
|
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiQrCodeData
|
||||||
import io.element.android.libraries.matrix.test.A_HOMESERVER_URL
|
import io.element.android.libraries.matrix.test.A_HOMESERVER_URL
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class SdkQrCodeLoginDataTest {
|
class SdkQrCodeLoginDataTest {
|
||||||
@Test
|
@Test
|
||||||
fun `getServer reads the value from the Rust side, null case`() {
|
fun `getServer reads the value from the Rust side, null case`() {
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,12 @@ import io.element.android.tests.testutils.lambda.lambdaRecorder
|
||||||
import io.element.android.tests.testutils.testCoroutineDispatchers
|
import io.element.android.tests.testutils.testCoroutineDispatchers
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.NotificationClient
|
import org.matrix.rustcomponents.sdk.NotificationClient
|
||||||
import org.matrix.rustcomponents.sdk.NotificationStatus
|
import org.matrix.rustcomponents.sdk.NotificationStatus
|
||||||
import org.matrix.rustcomponents.sdk.TimelineEventType
|
import org.matrix.rustcomponents.sdk.TimelineEventType
|
||||||
|
|
||||||
class RustNotificationServiceTest {
|
class RustNotificationServiceTest {
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun test() = runTest {
|
fun test() = runTest {
|
||||||
val notificationClient = FakeFfiNotificationClient(
|
val notificationClient = FakeFfiNotificationClient(
|
||||||
|
|
@ -58,7 +56,6 @@ class RustNotificationServiceTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `test mapping invalid item only drops that item`() = runTest {
|
fun `test mapping invalid item only drops that item`() = runTest {
|
||||||
val error = IllegalStateException("This event type is not supported")
|
val error = IllegalStateException("This event type is not supported")
|
||||||
|
|
@ -86,7 +83,6 @@ class RustNotificationServiceTest {
|
||||||
assertThat(successfulResult?.isSuccess).isTrue()
|
assertThat(successfulResult?.isSuccess).isTrue()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `test unable to resolve event`() = runTest {
|
fun `test unable to resolve event`() = runTest {
|
||||||
val notificationClient = FakeFfiNotificationClient(
|
val notificationClient = FakeFfiNotificationClient(
|
||||||
|
|
@ -99,7 +95,6 @@ class RustNotificationServiceTest {
|
||||||
assertThat(exception).isInstanceOf(NotificationResolverException::class.java)
|
assertThat(exception).isInstanceOf(NotificationResolverException::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `close should invoke the close method of the service`() = runTest {
|
fun `close should invoke the close method of the service`() = runTest {
|
||||||
val closeResult = lambdaRecorder<Unit> { }
|
val closeResult = lambdaRecorder<Unit> { }
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,10 @@ import io.element.android.libraries.matrix.test.A_ROOM_ID
|
||||||
import io.element.android.tests.testutils.testCoroutineDispatchers
|
import io.element.android.tests.testutils.testCoroutineDispatchers
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.NotificationSettings
|
import org.matrix.rustcomponents.sdk.NotificationSettings
|
||||||
|
|
||||||
class RustNotificationSettingsServiceTest {
|
class RustNotificationSettingsServiceTest {
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun test() = runTest {
|
fun test() = runTest {
|
||||||
val sut = createRustNotificationSettingsService()
|
val sut = createRustNotificationSettingsService()
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,8 @@ import io.element.android.libraries.matrix.api.pusher.UnsetHttpPusherData
|
||||||
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiClient
|
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiClient
|
||||||
import io.element.android.tests.testutils.testCoroutineDispatchers
|
import io.element.android.tests.testutils.testCoroutineDispatchers
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class RustPushersServiceTest {
|
class RustPushersServiceTest {
|
||||||
@Test
|
@Test
|
||||||
fun `setPusher should invoke the client method`() = runTest {
|
fun `setPusher should invoke the client method`() = runTest {
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,8 @@ import io.element.android.libraries.matrix.api.user.MatrixUser
|
||||||
import io.element.android.libraries.matrix.impl.fixtures.factories.aRustRoomHero
|
import io.element.android.libraries.matrix.impl.fixtures.factories.aRustRoomHero
|
||||||
import io.element.android.libraries.matrix.impl.fixtures.factories.aRustRoomInfo
|
import io.element.android.libraries.matrix.impl.fixtures.factories.aRustRoomInfo
|
||||||
import io.element.android.libraries.matrix.test.A_USER_ID
|
import io.element.android.libraries.matrix.test.A_USER_ID
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class RoomInfoExtTest {
|
class RoomInfoExtTest {
|
||||||
@Test
|
@Test
|
||||||
fun `get non empty element Heroes`() {
|
fun `get non empty element Heroes`() {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ import io.element.android.libraries.matrix.test.room.defaultRoomPowerLevelValues
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
import kotlinx.collections.immutable.persistentMapOf
|
import kotlinx.collections.immutable.persistentMapOf
|
||||||
import kotlinx.collections.immutable.toImmutableList
|
import kotlinx.collections.immutable.toImmutableList
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.Membership
|
import org.matrix.rustcomponents.sdk.Membership
|
||||||
import uniffi.matrix_sdk_base.EncryptionState
|
import uniffi.matrix_sdk_base.EncryptionState
|
||||||
|
|
@ -40,7 +39,6 @@ import org.matrix.rustcomponents.sdk.JoinRule as RustJoinRule
|
||||||
import org.matrix.rustcomponents.sdk.RoomHistoryVisibility as RustRoomHistoryVisibility
|
import org.matrix.rustcomponents.sdk.RoomHistoryVisibility as RustRoomHistoryVisibility
|
||||||
import org.matrix.rustcomponents.sdk.RoomNotificationMode as RustRoomNotificationMode
|
import org.matrix.rustcomponents.sdk.RoomNotificationMode as RustRoomNotificationMode
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class RoomInfoMapperTest {
|
class RoomInfoMapperTest {
|
||||||
@Test
|
@Test
|
||||||
fun `mapping of RustRoomInfo should map all the fields`() {
|
fun `mapping of RustRoomInfo should map all the fields`() {
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,9 @@ import kotlinx.coroutines.flow.shareIn
|
||||||
import kotlinx.coroutines.isActive
|
import kotlinx.coroutines.isActive
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import uniffi.matrix_sdk.RoomMemberRole
|
import uniffi.matrix_sdk.RoomMemberRole
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class RustBaseRoomTest {
|
class RustBaseRoomTest {
|
||||||
@Test
|
@Test
|
||||||
fun `RustBaseRoom should cancel the room coroutine scope when it is destroyed`() = runTest {
|
fun `RustBaseRoom should cancel the room coroutine scope when it is destroyed`() = runTest {
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,8 @@ import io.element.android.services.analytics.test.FakeAnalyticsService
|
||||||
import io.element.android.tests.testutils.lambda.lambdaRecorder
|
import io.element.android.tests.testutils.lambda.lambdaRecorder
|
||||||
import io.element.android.tests.testutils.lambda.value
|
import io.element.android.tests.testutils.lambda.value
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class DefaultJoinRoomTest {
|
class DefaultJoinRoomTest {
|
||||||
@Test
|
@Test
|
||||||
fun `when using roomId and there is no server names, the classic join room API is used`() = runTest {
|
fun `when using roomId and there is no server names, the classic join room API is used`() = runTest {
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,8 @@ import io.element.android.libraries.matrix.test.A_USER_ID_3
|
||||||
import io.element.android.libraries.matrix.test.A_USER_ID_4
|
import io.element.android.libraries.matrix.test.A_USER_ID_4
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class RoomMemberListFetcherTest {
|
class RoomMemberListFetcherTest {
|
||||||
@Test
|
@Test
|
||||||
fun `fetchRoomMembers with CACHE source - emits cached members, if any`() = runTest {
|
fun `fetchRoomMembers with CACHE source - emits cached members, if any`() = runTest {
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,10 @@ import kotlinx.coroutines.test.StandardTestDispatcher
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runCurrent
|
import kotlinx.coroutines.test.runCurrent
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.RoomDirectorySearch
|
import org.matrix.rustcomponents.sdk.RoomDirectorySearch
|
||||||
import org.matrix.rustcomponents.sdk.RoomDirectorySearchEntryUpdate
|
import org.matrix.rustcomponents.sdk.RoomDirectorySearchEntryUpdate
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@OptIn(ExperimentalCoroutinesApi::class)
|
@OptIn(ExperimentalCoroutinesApi::class)
|
||||||
class RustBaseRoomDirectoryListTest {
|
class RustBaseRoomDirectoryListTest {
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,9 @@ package io.element.android.libraries.matrix.impl.roomdirectory
|
||||||
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiClient
|
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiClient
|
||||||
import kotlinx.coroutines.test.StandardTestDispatcher
|
import kotlinx.coroutines.test.StandardTestDispatcher
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class RustBaseRoomDirectoryServiceTest {
|
class RustBaseRoomDirectoryServiceTest {
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun test() = runTest {
|
fun test() = runTest {
|
||||||
val client = FakeFfiClient()
|
val client = FakeFfiClient()
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,10 @@ import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiRoomList
|
||||||
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiRoomListService
|
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiRoomListService
|
||||||
import io.element.android.services.analytics.test.FakeAnalyticsService
|
import io.element.android.services.analytics.test.FakeAnalyticsService
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import kotlin.coroutines.EmptyCoroutineContext
|
import kotlin.coroutines.EmptyCoroutineContext
|
||||||
|
|
||||||
class RoomListFactoryTest {
|
class RoomListFactoryTest {
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `createRoomList should work`() = runTest {
|
fun `createRoomList should work`() = runTest {
|
||||||
val sut = RoomListFactory(
|
val sut = RoomListFactory(
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,12 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.test.StandardTestDispatcher
|
import kotlinx.coroutines.test.StandardTestDispatcher
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.RoomListEntriesUpdate
|
import org.matrix.rustcomponents.sdk.RoomListEntriesUpdate
|
||||||
|
|
||||||
class RoomSummaryListProcessorTest {
|
class RoomSummaryListProcessorTest {
|
||||||
private val summaries = MutableStateFlow<List<RoomSummary>>(emptyList())
|
private val summaries = MutableStateFlow<List<RoomSummary>>(emptyList())
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Append adds new entries at the end of the list`() = runTest {
|
fun `Append adds new entries at the end of the list`() = runTest {
|
||||||
summaries.value = listOf(aRoomSummary())
|
summaries.value = listOf(aRoomSummary())
|
||||||
|
|
@ -41,7 +39,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(summaries.value.subList(1, 4).all { it.roomId == A_ROOM_ID_2 }).isTrue()
|
assertThat(summaries.value.subList(1, 4).all { it.roomId == A_ROOM_ID_2 }).isTrue()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PushBack adds a new entry at the end of the list`() = runTest {
|
fun `PushBack adds a new entry at the end of the list`() = runTest {
|
||||||
summaries.value = listOf(aRoomSummary())
|
summaries.value = listOf(aRoomSummary())
|
||||||
|
|
@ -52,7 +49,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(summaries.value.last().roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(summaries.value.last().roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PushFront inserts a new entry at the start of the list`() = runTest {
|
fun `PushFront inserts a new entry at the start of the list`() = runTest {
|
||||||
summaries.value = listOf(aRoomSummary())
|
summaries.value = listOf(aRoomSummary())
|
||||||
|
|
@ -63,7 +59,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(summaries.value.first().roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(summaries.value.first().roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Set replaces an entry at some index`() = runTest {
|
fun `Set replaces an entry at some index`() = runTest {
|
||||||
summaries.value = listOf(aRoomSummary())
|
summaries.value = listOf(aRoomSummary())
|
||||||
|
|
@ -76,7 +71,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Insert inserts a new entry at the provided index`() = runTest {
|
fun `Insert inserts a new entry at the provided index`() = runTest {
|
||||||
summaries.value = listOf(aRoomSummary())
|
summaries.value = listOf(aRoomSummary())
|
||||||
|
|
@ -89,7 +83,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Remove removes an entry at some index`() = runTest {
|
fun `Remove removes an entry at some index`() = runTest {
|
||||||
summaries.value = listOf(
|
summaries.value = listOf(
|
||||||
|
|
@ -105,7 +98,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PopBack removes an entry at the end of the list`() = runTest {
|
fun `PopBack removes an entry at the end of the list`() = runTest {
|
||||||
summaries.value = listOf(
|
summaries.value = listOf(
|
||||||
|
|
@ -121,7 +113,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID)
|
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PopFront removes an entry at the start of the list`() = runTest {
|
fun `PopFront removes an entry at the start of the list`() = runTest {
|
||||||
summaries.value = listOf(
|
summaries.value = listOf(
|
||||||
|
|
@ -137,7 +128,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Clear removes all the entries`() = runTest {
|
fun `Clear removes all the entries`() = runTest {
|
||||||
summaries.value = listOf(
|
summaries.value = listOf(
|
||||||
|
|
@ -151,7 +141,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(summaries.value).isEmpty()
|
assertThat(summaries.value).isEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Truncate removes all entries after the provided length`() = runTest {
|
fun `Truncate removes all entries after the provided length`() = runTest {
|
||||||
summaries.value = listOf(
|
summaries.value = listOf(
|
||||||
|
|
@ -167,7 +156,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID)
|
assertThat(summaries.value[index].roomId).isEqualTo(A_ROOM_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Reset removes all entries and add the provided ones`() = runTest {
|
fun `Reset removes all entries and add the provided ones`() = runTest {
|
||||||
summaries.value = listOf(
|
summaries.value = listOf(
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,10 @@ import kotlinx.coroutines.test.StandardTestDispatcher
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runCurrent
|
import kotlinx.coroutines.test.runCurrent
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.RoomListServiceSyncIndicator
|
import org.matrix.rustcomponents.sdk.RoomListServiceSyncIndicator
|
||||||
import org.matrix.rustcomponents.sdk.RoomListService as RustRoomListService
|
import org.matrix.rustcomponents.sdk.RoomListService as RustRoomListService
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@OptIn(ExperimentalCoroutinesApi::class)
|
@OptIn(ExperimentalCoroutinesApi::class)
|
||||||
class RustBaseRoomListServiceTest {
|
class RustBaseRoomListServiceTest {
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,12 @@ import io.element.android.libraries.previewutils.room.aSpaceRoom
|
||||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.SpaceListUpdate
|
import org.matrix.rustcomponents.sdk.SpaceListUpdate
|
||||||
|
|
||||||
class RoomSummaryListProcessorTest {
|
class RoomSummaryListProcessorTest {
|
||||||
private val spaceRoomsFlow = MutableStateFlow<List<SpaceRoom>>(emptyList())
|
private val spaceRoomsFlow = MutableStateFlow<List<SpaceRoom>>(emptyList())
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Append adds new entries at the end of the list`() = runTest {
|
fun `Append adds new entries at the end of the list`() = runTest {
|
||||||
spaceRoomsFlow.value = listOf(aSpaceRoom())
|
spaceRoomsFlow.value = listOf(aSpaceRoom())
|
||||||
|
|
@ -38,7 +36,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(spaceRoomsFlow.value.subList(1, 4).all { it.roomId == A_ROOM_ID_2 }).isTrue()
|
assertThat(spaceRoomsFlow.value.subList(1, 4).all { it.roomId == A_ROOM_ID_2 }).isTrue()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PushBack adds a new entry at the end of the list`() = runTest {
|
fun `PushBack adds a new entry at the end of the list`() = runTest {
|
||||||
spaceRoomsFlow.value = listOf(aSpaceRoom())
|
spaceRoomsFlow.value = listOf(aSpaceRoom())
|
||||||
|
|
@ -49,7 +46,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(spaceRoomsFlow.value.last().roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(spaceRoomsFlow.value.last().roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PushFront inserts a new entry at the start of the list`() = runTest {
|
fun `PushFront inserts a new entry at the start of the list`() = runTest {
|
||||||
spaceRoomsFlow.value = listOf(aSpaceRoom())
|
spaceRoomsFlow.value = listOf(aSpaceRoom())
|
||||||
|
|
@ -60,7 +56,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(spaceRoomsFlow.value.first().roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(spaceRoomsFlow.value.first().roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Set replaces an entry at some index`() = runTest {
|
fun `Set replaces an entry at some index`() = runTest {
|
||||||
spaceRoomsFlow.value = listOf(aSpaceRoom())
|
spaceRoomsFlow.value = listOf(aSpaceRoom())
|
||||||
|
|
@ -73,7 +68,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Insert inserts a new entry at the provided index`() = runTest {
|
fun `Insert inserts a new entry at the provided index`() = runTest {
|
||||||
spaceRoomsFlow.value = listOf(aSpaceRoom())
|
spaceRoomsFlow.value = listOf(aSpaceRoom())
|
||||||
|
|
@ -86,7 +80,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Remove removes an entry at some index`() = runTest {
|
fun `Remove removes an entry at some index`() = runTest {
|
||||||
spaceRoomsFlow.value = listOf(
|
spaceRoomsFlow.value = listOf(
|
||||||
|
|
@ -102,7 +95,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PopBack removes an entry at the end of the list`() = runTest {
|
fun `PopBack removes an entry at the end of the list`() = runTest {
|
||||||
spaceRoomsFlow.value = listOf(
|
spaceRoomsFlow.value = listOf(
|
||||||
|
|
@ -118,7 +110,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID)
|
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PopFront removes an entry at the start of the list`() = runTest {
|
fun `PopFront removes an entry at the start of the list`() = runTest {
|
||||||
spaceRoomsFlow.value = listOf(
|
spaceRoomsFlow.value = listOf(
|
||||||
|
|
@ -134,7 +125,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Clear removes all the entries`() = runTest {
|
fun `Clear removes all the entries`() = runTest {
|
||||||
spaceRoomsFlow.value = listOf(
|
spaceRoomsFlow.value = listOf(
|
||||||
|
|
@ -148,7 +138,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(spaceRoomsFlow.value).isEmpty()
|
assertThat(spaceRoomsFlow.value).isEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Truncate removes all entries after the provided length`() = runTest {
|
fun `Truncate removes all entries after the provided length`() = runTest {
|
||||||
spaceRoomsFlow.value = listOf(
|
spaceRoomsFlow.value = listOf(
|
||||||
|
|
@ -164,7 +153,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID)
|
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Reset removes all entries and add the provided ones`() = runTest {
|
fun `Reset removes all entries and add the provided ones`() = runTest {
|
||||||
spaceRoomsFlow.value = listOf(
|
spaceRoomsFlow.value = listOf(
|
||||||
|
|
@ -180,7 +168,6 @@ class RoomSummaryListProcessorTest {
|
||||||
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID_3)
|
assertThat(spaceRoomsFlow.value[index].roomId).isEqualTo(A_ROOM_ID_3)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `When there is no replay cache SpaceListUpdateProcessor starts with an empty list`() = runTest {
|
fun `When there is no replay cache SpaceListUpdateProcessor starts with an empty list`() = runTest {
|
||||||
val spaceRoomsSharedFlow = MutableSharedFlow<List<SpaceRoom>>(replay = 1)
|
val spaceRoomsSharedFlow = MutableSharedFlow<List<SpaceRoom>>(replay = 1)
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,12 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runCurrent
|
import kotlinx.coroutines.test.runCurrent
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.SpaceListUpdate
|
import org.matrix.rustcomponents.sdk.SpaceListUpdate
|
||||||
import uniffi.matrix_sdk_ui.SpaceRoomListPaginationState
|
import uniffi.matrix_sdk_ui.SpaceRoomListPaginationState
|
||||||
import org.matrix.rustcomponents.sdk.SpaceRoomList as InnerSpaceRoomList
|
import org.matrix.rustcomponents.sdk.SpaceRoomList as InnerSpaceRoomList
|
||||||
|
|
||||||
class RustSpaceRoomListTest {
|
class RustSpaceRoomListTest {
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `paginationStatusFlow emits values`() = runTest {
|
fun `paginationStatusFlow emits values`() = runTest {
|
||||||
val innerSpaceRoomList = FakeFfiSpaceRoomList(
|
val innerSpaceRoomList = FakeFfiSpaceRoomList(
|
||||||
|
|
@ -53,7 +51,6 @@ class RustSpaceRoomListTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `spaceRoomsFlow emits values`() = runTest {
|
fun `spaceRoomsFlow emits values`() = runTest {
|
||||||
val innerSpaceRoomList = FakeFfiSpaceRoomList(
|
val innerSpaceRoomList = FakeFfiSpaceRoomList(
|
||||||
|
|
@ -76,7 +73,6 @@ class RustSpaceRoomListTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `paginate invokes paginate on the inner class`() = runTest {
|
fun `paginate invokes paginate on the inner class`() = runTest {
|
||||||
val paginateResult = lambdaRecorder<Unit> { }
|
val paginateResult = lambdaRecorder<Unit> { }
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import kotlinx.coroutines.flow.MutableSharedFlow
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.TimelineDiff
|
import org.matrix.rustcomponents.sdk.TimelineDiff
|
||||||
|
|
||||||
|
|
@ -31,7 +30,6 @@ class MatrixTimelineDiffProcessorTest {
|
||||||
private val anEvent = MatrixTimelineItem.Event(A_UNIQUE_ID, anEventTimelineItem())
|
private val anEvent = MatrixTimelineItem.Event(A_UNIQUE_ID, anEventTimelineItem())
|
||||||
private val anEvent2 = MatrixTimelineItem.Event(A_UNIQUE_ID_2, anEventTimelineItem())
|
private val anEvent2 = MatrixTimelineItem.Event(A_UNIQUE_ID_2, anEventTimelineItem())
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Append adds new entries at the end of the list`() = runTest {
|
fun `Append adds new entries at the end of the list`() = runTest {
|
||||||
timelineItems.value = listOf(anEvent)
|
timelineItems.value = listOf(anEvent)
|
||||||
|
|
@ -44,7 +42,6 @@ class MatrixTimelineDiffProcessorTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PushBack adds a new entry at the end of the list`() = runTest {
|
fun `PushBack adds a new entry at the end of the list`() = runTest {
|
||||||
timelineItems.value = listOf(anEvent)
|
timelineItems.value = listOf(anEvent)
|
||||||
|
|
@ -57,7 +54,6 @@ class MatrixTimelineDiffProcessorTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PushFront inserts a new entry at the start of the list`() = runTest {
|
fun `PushFront inserts a new entry at the start of the list`() = runTest {
|
||||||
timelineItems.value = listOf(anEvent)
|
timelineItems.value = listOf(anEvent)
|
||||||
|
|
@ -70,7 +66,6 @@ class MatrixTimelineDiffProcessorTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Set replaces an entry at some index`() = runTest {
|
fun `Set replaces an entry at some index`() = runTest {
|
||||||
timelineItems.value = listOf(anEvent, anEvent2)
|
timelineItems.value = listOf(anEvent, anEvent2)
|
||||||
|
|
@ -83,7 +78,6 @@ class MatrixTimelineDiffProcessorTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Insert inserts a new entry at the provided index`() = runTest {
|
fun `Insert inserts a new entry at the provided index`() = runTest {
|
||||||
timelineItems.value = listOf(anEvent, anEvent2)
|
timelineItems.value = listOf(anEvent, anEvent2)
|
||||||
|
|
@ -97,7 +91,6 @@ class MatrixTimelineDiffProcessorTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Remove removes an entry at some index`() = runTest {
|
fun `Remove removes an entry at some index`() = runTest {
|
||||||
timelineItems.value = listOf(anEvent, MatrixTimelineItem.Other, anEvent2)
|
timelineItems.value = listOf(anEvent, MatrixTimelineItem.Other, anEvent2)
|
||||||
|
|
@ -110,7 +103,6 @@ class MatrixTimelineDiffProcessorTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PopBack removes an entry at the end of the list`() = runTest {
|
fun `PopBack removes an entry at the end of the list`() = runTest {
|
||||||
timelineItems.value = listOf(anEvent, anEvent2)
|
timelineItems.value = listOf(anEvent, anEvent2)
|
||||||
|
|
@ -122,7 +114,6 @@ class MatrixTimelineDiffProcessorTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `PopFront removes an entry at the start of the list`() = runTest {
|
fun `PopFront removes an entry at the start of the list`() = runTest {
|
||||||
timelineItems.value = listOf(anEvent, anEvent2)
|
timelineItems.value = listOf(anEvent, anEvent2)
|
||||||
|
|
@ -134,7 +125,6 @@ class MatrixTimelineDiffProcessorTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Clear removes all the entries`() = runTest {
|
fun `Clear removes all the entries`() = runTest {
|
||||||
timelineItems.value = listOf(anEvent, anEvent2)
|
timelineItems.value = listOf(anEvent, anEvent2)
|
||||||
|
|
@ -143,7 +133,6 @@ class MatrixTimelineDiffProcessorTest {
|
||||||
assertThat(timelineItems.value).isEmpty()
|
assertThat(timelineItems.value).isEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Truncate removes all entries after the provided length`() = runTest {
|
fun `Truncate removes all entries after the provided length`() = runTest {
|
||||||
timelineItems.value = listOf(anEvent, MatrixTimelineItem.Other, anEvent2)
|
timelineItems.value = listOf(anEvent, MatrixTimelineItem.Other, anEvent2)
|
||||||
|
|
@ -155,7 +144,6 @@ class MatrixTimelineDiffProcessorTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `Reset removes all entries and add the provided ones`() = runTest {
|
fun `Reset removes all entries and add the provided ones`() = runTest {
|
||||||
timelineItems.value = listOf(anEvent, MatrixTimelineItem.Other, anEvent2)
|
timelineItems.value = listOf(anEvent, MatrixTimelineItem.Other, anEvent2)
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,11 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runCurrent
|
import kotlinx.coroutines.test.runCurrent
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.TimelineDiff
|
import org.matrix.rustcomponents.sdk.TimelineDiff
|
||||||
import uniffi.matrix_sdk.RoomPaginationStatus
|
import uniffi.matrix_sdk.RoomPaginationStatus
|
||||||
import org.matrix.rustcomponents.sdk.Timeline as InnerTimeline
|
import org.matrix.rustcomponents.sdk.Timeline as InnerTimeline
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
class RustTimelineTest {
|
class RustTimelineTest {
|
||||||
@Test
|
@Test
|
||||||
fun `ensure that the timeline emits new loading item when pagination does not bring new events`() = runTest {
|
fun `ensure that the timeline emits new loading item when pagination does not bring new events`() = runTest {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ import kotlinx.coroutines.test.StandardTestDispatcher
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.runCurrent
|
import kotlinx.coroutines.test.runCurrent
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.Timeline
|
import org.matrix.rustcomponents.sdk.Timeline
|
||||||
import org.matrix.rustcomponents.sdk.TimelineDiff
|
import org.matrix.rustcomponents.sdk.TimelineDiff
|
||||||
|
|
@ -28,7 +27,6 @@ import uniffi.matrix_sdk_ui.EventItemOrigin
|
||||||
|
|
||||||
@OptIn(ExperimentalCoroutinesApi::class)
|
@OptIn(ExperimentalCoroutinesApi::class)
|
||||||
class TimelineItemsSubscriberTest {
|
class TimelineItemsSubscriberTest {
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `when timeline emits an empty list of items, the flow must emits an empty list`() = runTest {
|
fun `when timeline emits an empty list of items, the flow must emits an empty list`() = runTest {
|
||||||
val timelineItems: MutableSharedFlow<List<MatrixTimelineItem>> =
|
val timelineItems: MutableSharedFlow<List<MatrixTimelineItem>> =
|
||||||
|
|
@ -52,7 +50,6 @@ class TimelineItemsSubscriberTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `when timeline emits a non empty list of items, the flow must emits a non empty list`() = runTest {
|
fun `when timeline emits a non empty list of items, the flow must emits a non empty list`() = runTest {
|
||||||
val timelineItems: MutableSharedFlow<List<MatrixTimelineItem>> =
|
val timelineItems: MutableSharedFlow<List<MatrixTimelineItem>> =
|
||||||
|
|
@ -76,7 +73,6 @@ class TimelineItemsSubscriberTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `when timeline emits an item with SYNC origin`() = runTest {
|
fun `when timeline emits an item with SYNC origin`() = runTest {
|
||||||
val timelineItems: MutableSharedFlow<List<MatrixTimelineItem>> =
|
val timelineItems: MutableSharedFlow<List<MatrixTimelineItem>> =
|
||||||
|
|
@ -108,7 +104,6 @@ class TimelineItemsSubscriberTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("JNA direct mapping has broken unit tests with FFI fakes")
|
|
||||||
@Test
|
@Test
|
||||||
fun `multiple subscriptions does not have side effect`() = runTest {
|
fun `multiple subscriptions does not have side effect`() = runTest {
|
||||||
val timelineItemsSubscriber = createTimelineItemsSubscriber()
|
val timelineItemsSubscriber = createTimelineItemsSubscriber()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue