Create Fake classes in test modules

This commit is contained in:
Benoit Marty
2025-10-30 18:32:31 +01:00
parent 0303ac502a
commit 187479849d
62 changed files with 798 additions and 327 deletions

View File

@@ -59,6 +59,7 @@ dependencies {
testImplementation(projects.libraries.preferences.test)
testImplementation(projects.libraries.push.test)
testImplementation(projects.libraries.pushproviders.test)
testImplementation(projects.features.forward.test)
testImplementation(projects.features.networkmonitor.test)
testImplementation(projects.features.rageshake.test)
testImplementation(projects.services.appnavstate.test)

View File

@@ -22,6 +22,7 @@ import io.element.android.appnav.room.RoomNavigationTarget
import io.element.android.appnav.room.joined.FakeJoinedRoomLoadedFlowNodeCallback
import io.element.android.appnav.room.joined.JoinedRoomLoadedFlowNode
import io.element.android.features.forward.api.ForwardEntryPoint
import io.element.android.features.forward.test.FakeForwardEntryPoint
import io.element.android.features.messages.api.MessagesEntryPoint
import io.element.android.features.roomdetails.api.RoomDetailsEntryPoint
import io.element.android.features.space.api.SpaceEntryPoint
@@ -100,15 +101,6 @@ class JoinedRoomLoadedFlowNodeTest {
}
}
private class FakeForwardEntryPoint : ForwardEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: ForwardEntryPoint.Params,
callback: ForwardEntryPoint.Callback,
) = node(buildContext) {}
}
private fun TestScope.createJoinedRoomLoadedFlowNode(
plugins: List<Plugin>,
messagesEntryPoint: MessagesEntryPoint = FakeMessagesEntryPoint(),

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.features.changeroommemberroles.test"
}
dependencies {
implementation(projects.features.changeroommemberroles.api)
implementation(projects.libraries.architecture)
implementation(projects.libraries.matrix.api)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.changeroommemberroes.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.changeroommemberroes.api.ChangeRoomMemberRolesEntryPoint
import io.element.android.features.changeroommemberroes.api.ChangeRoomMemberRolesListType
import io.element.android.libraries.matrix.api.room.JoinedRoom
import io.element.android.tests.testutils.lambda.lambdaError
class FakeChangeRoomMemberRolesEntryPoint : ChangeRoomMemberRolesEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
room: JoinedRoom,
listType: ChangeRoomMemberRolesListType,
): Node {
lambdaError()
}
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.features.createroom.test"
}
dependencies {
implementation(projects.features.createroom.api)
implementation(projects.libraries.architecture)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,20 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.createroom.api
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.tests.testutils.lambda.lambdaError
class FakeCreateRoomEntryPoint : CreateRoomEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
callback: CreateRoomEntryPoint.Callback,
): Node = lambdaError()
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.features.deactivation.test"
}
dependencies {
implementation(projects.features.deactivation.api)
implementation(projects.libraries.architecture)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,20 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.deactivation.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.deactivation.api.AccountDeactivationEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeAccountDeactivationEntryPoint : AccountDeactivationEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext): Node {
lambdaError()
}
}

View File

@@ -34,5 +34,6 @@ dependencies {
testCommonDependencies(libs, true)
testImplementation(projects.libraries.matrix.test)
testImplementation(projects.libraries.roomselect.test)
testImplementation(projects.libraries.testtags)
}

View File

@@ -9,14 +9,13 @@ package io.element.android.features.forward.impl
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.features.forward.api.ForwardEntryPoint
import io.element.android.libraries.matrix.api.core.RoomId
import io.element.android.libraries.matrix.test.AN_EVENT_ID
import io.element.android.libraries.matrix.test.timeline.FakeTimelineProvider
import io.element.android.libraries.roomselect.api.RoomSelectEntryPoint
import io.element.android.libraries.roomselect.test.FakeRoomSelectEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
import io.element.android.tests.testutils.node.TestParentNode
import kotlinx.coroutines.test.runTest
@@ -38,14 +37,7 @@ class DefaultForwardEntryPointTest {
buildContext = buildContext,
plugins = plugins,
presenterFactory = { _, _ -> createForwardMessagesPresenter() },
roomSelectEntryPoint = object : RoomSelectEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: RoomSelectEntryPoint.Params,
callback: RoomSelectEntryPoint.Callback,
) = lambdaError()
}
roomSelectEntryPoint = FakeRoomSelectEntryPoint(),
)
}
val callback = object : ForwardEntryPoint.Callback {

View File

@@ -0,0 +1,20 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.features.forward.test"
}
dependencies {
implementation(projects.libraries.architecture)
implementation(projects.libraries.matrix.api)
implementation(projects.features.forward.api)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.forward.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.forward.api.ForwardEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeForwardEntryPoint : ForwardEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: ForwardEntryPoint.Params,
callback: ForwardEntryPoint.Callback,
): Node = lambdaError()
}

View File

@@ -7,14 +7,11 @@
package io.element.android.features.ftue.impl
import android.content.Context
import android.content.Intent
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.features.lockscreen.api.LockScreenEntryPoint
import io.element.android.features.lockscreen.test.FakeLockScreenEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
import io.element.android.tests.testutils.node.TestParentNode
import kotlinx.coroutines.test.runTest
@@ -37,18 +34,7 @@ class DefaultFtueEntryPointTest {
plugins = plugins,
analyticsEntryPoint = { _ -> lambdaError() },
defaultFtueService = createDefaultFtueService(),
lockScreenEntryPoint = object : LockScreenEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
navTarget: LockScreenEntryPoint.Target,
callback: LockScreenEntryPoint.Callback,
) = lambdaError()
override fun pinUnlockIntent(context: Context): Intent {
lambdaError()
}
},
lockScreenEntryPoint = FakeLockScreenEntryPoint(),
)
}
val result = with(parentNode) {

View File

@@ -26,5 +26,6 @@ dependencies {
implementation(libs.coroutines.core)
implementation(projects.libraries.matrix.api)
implementation(projects.libraries.matrix.test)
implementation(projects.tests.testutils)
api(projects.features.invite.api)
}

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.invite.test.declineandblock
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.invite.api.InviteData
import io.element.android.features.invite.api.declineandblock.DeclineInviteAndBlockEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeDeclineInviteAndBlockEntryPoint : DeclineInviteAndBlockEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext, inviteData: InviteData): Node {
lambdaError()
}
}

View File

@@ -9,12 +9,10 @@ package io.element.android.features.joinroom.impl
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import im.vector.app.features.analytics.plan.JoinedRoom
import io.element.android.features.invite.api.InviteData
import io.element.android.features.invite.api.declineandblock.DeclineInviteAndBlockEntryPoint
import io.element.android.features.invite.test.declineandblock.FakeDeclineInviteAndBlockEntryPoint
import io.element.android.features.joinroom.api.JoinRoomEntryPoint
import io.element.android.libraries.matrix.api.core.toRoomIdOrAlias
import io.element.android.libraries.matrix.test.A_ROOM_ID
@@ -40,10 +38,7 @@ class DefaultJoinRoomEntryPointTest {
plugins = plugins,
presenterFactory = { _, _, _, _, _ -> createJoinRoomPresenter() },
acceptDeclineInviteView = { _, _, _, _ -> lambdaError() },
declineAndBlockEntryPoint = object : DeclineInviteAndBlockEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext, inviteData: InviteData) = lambdaError()
}
declineAndBlockEntryPoint = FakeDeclineInviteAndBlockEntryPoint(),
)
}
val inputs = JoinRoomEntryPoint.Inputs(

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.features.knockrequests.test"
}
dependencies {
implementation(projects.features.knockrequests.api)
implementation(projects.libraries.architecture)
implementation(projects.libraries.matrix.api)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,18 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.knockrequests.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.knockrequests.api.list.KnockRequestsListEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeKnockRequestsListEntryPoint : KnockRequestsListEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext): Node = lambdaError()
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.features.licenses.test"
}
dependencies {
implementation(projects.features.licenses.api)
implementation(projects.libraries.architecture)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,20 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.licenses.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.licenses.api.OpenSourceLicensesEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeOpenSourceLicensesEntryPoint : OpenSourceLicensesEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext): Node {
lambdaError()
}
}

View File

@@ -14,5 +14,8 @@ android {
}
dependencies {
implementation(projects.features.location.api)
api(projects.features.location.api)
implementation(projects.libraries.matrix.api)
implementation(libs.appyx.core)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.location.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.location.api.SendLocationEntryPoint
import io.element.android.libraries.matrix.api.timeline.Timeline
import io.element.android.tests.testutils.lambda.lambdaError
class FakeSendLocationEntryPoint : SendLocationEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
timelineMode: Timeline.Mode,
): Node = lambdaError()
}

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.location.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.location.api.ShowLocationEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeShowLocationEntryPoint : ShowLocationEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
inputs: ShowLocationEntryPoint.Inputs,
): Node = lambdaError()
}

View File

@@ -14,6 +14,8 @@ android {
}
dependencies {
implementation(libs.coroutines.core)
api(projects.features.lockscreen.api)
implementation(libs.coroutines.core)
implementation(projects.libraries.architecture)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.lockscreen.test
import android.content.Context
import android.content.Intent
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.lockscreen.api.LockScreenEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeLockScreenEntryPoint : LockScreenEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
navTarget: LockScreenEntryPoint.Target,
callback: LockScreenEntryPoint.Callback,
): Node = lambdaError()
override fun pinUnlockIntent(context: Context): Intent = lambdaError()
}

View File

@@ -15,6 +15,7 @@ android {
dependencies {
implementation(libs.coroutines.core)
implementation(projects.libraries.architecture)
implementation(projects.tests.testutils)
api(projects.features.logout.api)
}

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.logout.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.logout.api.LogoutEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeLogoutEntryPoint : LogoutEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
callback: LogoutEntryPoint.Callback,
): Node = lambdaError()
}

View File

@@ -79,6 +79,9 @@ dependencies {
testImplementation(projects.libraries.matrix.test)
testImplementation(projects.libraries.dateformatter.test)
testImplementation(projects.libraries.push.test)
testImplementation(projects.features.call.test)
testImplementation(projects.features.forward.test)
testImplementation(projects.features.knockrequests.test)
testImplementation(projects.features.location.test)
testImplementation(projects.features.networkmonitor.test)
testImplementation(projects.features.messages.test)

View File

@@ -10,27 +10,23 @@ package io.element.android.features.messages.impl
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import androidx.compose.runtime.Composable
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.features.call.api.CallType
import io.element.android.features.call.api.ElementCallEntryPoint
import io.element.android.features.forward.api.ForwardEntryPoint
import io.element.android.features.knockrequests.api.list.KnockRequestsListEntryPoint
import io.element.android.features.location.api.SendLocationEntryPoint
import io.element.android.features.location.api.ShowLocationEntryPoint
import io.element.android.features.call.test.FakeElementCallEntryPoint
import io.element.android.features.forward.test.FakeForwardEntryPoint
import io.element.android.features.knockrequests.test.FakeKnockRequestsListEntryPoint
import io.element.android.features.location.test.FakeLocationService
import io.element.android.features.location.test.FakeSendLocationEntryPoint
import io.element.android.features.location.test.FakeShowLocationEntryPoint
import io.element.android.features.messages.api.MessagesEntryPoint
import io.element.android.features.messages.impl.pinned.banner.createPinnedEventsTimelineProvider
import io.element.android.features.messages.impl.timeline.createTimelineController
import io.element.android.features.poll.api.create.CreatePollEntryPoint
import io.element.android.features.poll.api.create.CreatePollEntryPoint.Params
import io.element.android.features.poll.test.create.FakeCreatePollEntryPoint
import io.element.android.libraries.dateformatter.test.FakeDateFormatter
import io.element.android.libraries.matrix.api.core.EventId
import io.element.android.libraries.matrix.api.core.RoomId
import io.element.android.libraries.matrix.api.core.UserId
import io.element.android.libraries.matrix.api.permalink.PermalinkData
import io.element.android.libraries.matrix.api.timeline.Timeline
import io.element.android.libraries.matrix.test.AN_EVENT_ID
import io.element.android.libraries.matrix.test.A_SESSION_ID
import io.element.android.libraries.matrix.test.A_USER_ID
@@ -38,7 +34,7 @@ import io.element.android.libraries.matrix.test.room.FakeBaseRoom
import io.element.android.libraries.matrix.test.roomlist.FakeRoomListService
import io.element.android.libraries.matrix.ui.messages.RoomMemberProfilesCache
import io.element.android.libraries.matrix.ui.messages.RoomNamesCache
import io.element.android.libraries.mediaviewer.api.MediaViewerEntryPoint
import io.element.android.libraries.mediaviewer.test.FakeMediaViewerEntryPoint
import io.element.android.libraries.textcomposer.mentions.MentionSpanTheme
import io.element.android.libraries.textcomposer.mentions.MentionSpanUpdater
import io.element.android.services.analytics.test.FakeAnalyticsService
@@ -65,56 +61,12 @@ class DefaultMessagesEntryPointTest {
plugins = plugins,
roomListService = FakeRoomListService(),
sessionId = A_SESSION_ID,
sendLocationEntryPoint = object : SendLocationEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
timelineMode: Timeline.Mode,
) = lambdaError()
},
showLocationEntryPoint = object : ShowLocationEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext, inputs: ShowLocationEntryPoint.Inputs) = lambdaError()
},
createPollEntryPoint = object : CreatePollEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: Params,
) = lambdaError()
},
elementCallEntryPoint = object : ElementCallEntryPoint {
override fun startCall(callType: CallType) = lambdaError()
override suspend fun handleIncomingCall(
callType: CallType.RoomCall,
eventId: EventId,
senderId: UserId,
roomName: String?,
senderName: String?,
avatarUrl: String?,
timestamp: Long,
expirationTimestamp: Long,
notificationChannelId: String,
textContent: String?,
) = lambdaError()
},
mediaViewerEntryPoint = object : MediaViewerEntryPoint {
override fun createParamsForAvatar(filename: String, avatarUrl: String) = lambdaError()
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: MediaViewerEntryPoint.Params,
callback: MediaViewerEntryPoint.Callback,
) = lambdaError()
},
forwardEntryPoint = object : ForwardEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: ForwardEntryPoint.Params,
callback: ForwardEntryPoint.Callback,
) = lambdaError()
},
sendLocationEntryPoint = FakeSendLocationEntryPoint(),
showLocationEntryPoint = FakeShowLocationEntryPoint(),
createPollEntryPoint = FakeCreatePollEntryPoint(),
elementCallEntryPoint = FakeElementCallEntryPoint(),
mediaViewerEntryPoint = FakeMediaViewerEntryPoint(),
forwardEntryPoint = FakeForwardEntryPoint(),
analyticsService = FakeAnalyticsService(),
locationService = FakeLocationService(),
room = FakeBaseRoom(),
@@ -129,10 +81,7 @@ class DefaultMessagesEntryPointTest {
mentionSpanTheme = MentionSpanTheme(A_USER_ID),
pinnedEventsTimelineProvider = createPinnedEventsTimelineProvider(),
timelineController = createTimelineController(),
knockRequestsListEntryPoint = object : KnockRequestsListEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext) = lambdaError()
},
knockRequestsListEntryPoint = FakeKnockRequestsListEntryPoint(),
dateFormatter = FakeDateFormatter(),
coroutineDispatchers = testCoroutineDispatchers(),
)

View File

@@ -23,4 +23,5 @@ dependencies {
implementation(projects.libraries.preferences.api)
implementation(projects.libraries.voicerecorder.test)
implementation(projects.services.analytics.test)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.messages.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.messages.api.MessagesEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeMessagesEntryPoint : MessagesEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: MessagesEntryPoint.Params,
callback: MessagesEntryPoint.Callback,
): Node = lambdaError()
}

View File

@@ -9,11 +9,9 @@ package io.element.android.features.poll.impl.history
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.features.poll.api.create.CreatePollEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
import io.element.android.features.poll.test.create.FakeCreatePollEntryPoint
import io.element.android.tests.testutils.node.TestParentNode
import kotlinx.coroutines.test.runTest
import org.junit.Rule
@@ -33,13 +31,7 @@ class DefaultPollHistoryEntryPointTest {
PollHistoryFlowNode(
buildContext = buildContext,
plugins = plugins,
createPollEntryPoint = object : CreatePollEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: CreatePollEntryPoint.Params,
) = lambdaError()
}
createPollEntryPoint = FakeCreatePollEntryPoint(),
)
}
val result = with(parentNode) {

View File

@@ -17,4 +17,5 @@ dependencies {
implementation(projects.libraries.matrix.api)
api(projects.features.poll.api)
implementation(libs.kotlinx.collections.immutable)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.poll.test.create
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.poll.api.create.CreatePollEntryPoint
import io.element.android.features.poll.api.create.CreatePollEntryPoint.Params
import io.element.android.tests.testutils.lambda.lambdaError
class FakeCreatePollEntryPoint : CreatePollEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: Params,
): Node = lambdaError()
}

View File

@@ -0,0 +1,20 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.poll.test.history
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.poll.api.history.PollHistoryEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakePollHistoryEntryPoint : PollHistoryEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
): Node = lambdaError()
}

View File

@@ -102,8 +102,13 @@ dependencies {
testImplementation(projects.libraries.preferences.test)
testImplementation(projects.libraries.push.test)
testImplementation(projects.libraries.pushstore.test)
testImplementation(projects.libraries.roomselect.test)
testImplementation(projects.libraries.troubleshoot.test)
testImplementation(projects.features.deactivation.test)
testImplementation(projects.features.enterprise.test)
testImplementation(projects.features.invite.test)
testImplementation(projects.features.licenses.test)
testImplementation(projects.features.lockscreen.test)
testImplementation(projects.features.rageshake.test)
testImplementation(projects.features.logout.test)
testImplementation(projects.libraries.indicator.test)

View File

@@ -7,21 +7,19 @@
package io.element.android.features.preferences.impl
import android.content.Context
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.features.deactivation.api.AccountDeactivationEntryPoint
import io.element.android.features.licenses.api.OpenSourceLicensesEntryPoint
import io.element.android.features.lockscreen.api.LockScreenEntryPoint
import io.element.android.features.logout.api.LogoutEntryPoint
import io.element.android.features.deactivation.test.FakeAccountDeactivationEntryPoint
import io.element.android.features.licenses.test.FakeOpenSourceLicensesEntryPoint
import io.element.android.features.lockscreen.test.FakeLockScreenEntryPoint
import io.element.android.features.logout.test.FakeLogoutEntryPoint
import io.element.android.features.preferences.api.PreferencesEntryPoint
import io.element.android.libraries.matrix.api.core.EventId
import io.element.android.libraries.matrix.api.core.RoomId
import io.element.android.libraries.troubleshoot.api.NotificationTroubleShootEntryPoint
import io.element.android.libraries.troubleshoot.api.PushHistoryEntryPoint
import io.element.android.libraries.troubleshoot.test.FakeNotificationTroubleShootEntryPoint
import io.element.android.libraries.troubleshoot.test.FakePushHistoryEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
import io.element.android.tests.testutils.node.TestParentNode
import org.junit.Rule
@@ -41,45 +39,12 @@ class DefaultPreferencesEntryPointTest {
PreferencesFlowNode(
buildContext = buildContext,
plugins = plugins,
lockScreenEntryPoint = object : LockScreenEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
navTarget: LockScreenEntryPoint.Target,
callback: LockScreenEntryPoint.Callback,
) = lambdaError()
override fun pinUnlockIntent(context: Context) = lambdaError()
},
notificationTroubleShootEntryPoint = object : NotificationTroubleShootEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
callback: NotificationTroubleShootEntryPoint.Callback,
) = lambdaError()
},
pushHistoryEntryPoint = object : PushHistoryEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
callback: PushHistoryEntryPoint.Callback,
) = lambdaError()
},
logoutEntryPoint = object : LogoutEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
callback: LogoutEntryPoint.Callback,
) = lambdaError()
},
openSourceLicensesEntryPoint = object : OpenSourceLicensesEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext) = lambdaError()
},
accountDeactivationEntryPoint = object : AccountDeactivationEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext) = lambdaError()
},
lockScreenEntryPoint = FakeLockScreenEntryPoint(),
notificationTroubleShootEntryPoint = FakeNotificationTroubleShootEntryPoint(),
pushHistoryEntryPoint = FakePushHistoryEntryPoint(),
logoutEntryPoint = FakeLogoutEntryPoint(),
openSourceLicensesEntryPoint = FakeOpenSourceLicensesEntryPoint(),
accountDeactivationEntryPoint = FakeAccountDeactivationEntryPoint(),
)
}
val callback = object : PreferencesEntryPoint.Callback {

View File

@@ -52,6 +52,7 @@ dependencies {
testImplementation(projects.libraries.matrix.test)
testImplementation(projects.libraries.sessionStorage.test)
testImplementation(projects.features.rageshake.test)
testImplementation(projects.features.viewfolder.test)
testImplementation(projects.libraries.preferences.test)
testImplementation(projects.services.toolbox.test)
testImplementation(libs.network.mockwebserver)

View File

@@ -9,11 +9,10 @@ package io.element.android.features.rageshake.impl.bugreport
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.features.rageshake.api.bugreport.BugReportEntryPoint
import io.element.android.features.viewfolder.api.ViewFolderEntryPoint
import io.element.android.features.viewfolder.test.FakeViewFolderEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
import io.element.android.tests.testutils.node.TestParentNode
import kotlinx.coroutines.test.runTest
@@ -34,14 +33,7 @@ class DefaultBugReportEntryPointTest {
BugReportFlowNode(
buildContext = buildContext,
plugins = plugins,
viewFolderEntryPoint = object : ViewFolderEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: ViewFolderEntryPoint.Params,
callback: ViewFolderEntryPoint.Callback,
) = lambdaError()
},
viewFolderEntryPoint = FakeViewFolderEntryPoint(),
)
}
val callback = object : BugReportEntryPoint.Callback {

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.features.reportroom.test"
}
dependencies {
implementation(projects.features.reportroom.api)
implementation(projects.libraries.architecture)
implementation(projects.libraries.matrix.api)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.reportroom.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.reportroom.api.ReportRoomEntryPoint
import io.element.android.libraries.matrix.api.core.RoomId
import io.element.android.tests.testutils.lambda.lambdaError
class FakeReportRoomEntryPoint : ReportRoomEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext, roomId: RoomId): Node {
lambdaError()
}
}

View File

@@ -63,10 +63,18 @@ dependencies {
testImplementation(projects.libraries.matrix.test)
testImplementation(projects.libraries.mediaupload.test)
testImplementation(projects.libraries.mediapickers.test)
testImplementation(projects.libraries.mediaviewer.test)
testImplementation(projects.libraries.permissions.test)
testImplementation(projects.libraries.preferences.test)
testImplementation(projects.libraries.usersearch.test)
testImplementation(projects.libraries.featureflag.test)
testImplementation(projects.features.call.test)
testImplementation(projects.features.changeroommemberroles.test)
testImplementation(projects.features.knockrequests.test)
testImplementation(projects.features.messages.test)
testImplementation(projects.features.poll.test)
testImplementation(projects.features.reportroom.test)
testImplementation(projects.features.startchat.test)
testImplementation(projects.features.verifysession.test)
testImplementation(projects.services.analytics.test)
}

View File

@@ -9,28 +9,23 @@ package io.element.android.features.roomdetails.impl
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.features.call.api.CallType
import io.element.android.features.call.api.ElementCallEntryPoint
import io.element.android.features.changeroommemberroes.api.ChangeRoomMemberRolesEntryPoint
import io.element.android.features.changeroommemberroes.api.ChangeRoomMemberRolesListType
import io.element.android.features.knockrequests.api.list.KnockRequestsListEntryPoint
import io.element.android.features.messages.api.MessagesEntryPoint
import io.element.android.features.poll.api.history.PollHistoryEntryPoint
import io.element.android.features.reportroom.api.ReportRoomEntryPoint
import io.element.android.features.call.test.FakeElementCallEntryPoint
import io.element.android.features.changeroommemberroes.test.FakeChangeRoomMemberRolesEntryPoint
import io.element.android.features.knockrequests.test.FakeKnockRequestsListEntryPoint
import io.element.android.features.messages.test.FakeMessagesEntryPoint
import io.element.android.features.poll.test.history.FakePollHistoryEntryPoint
import io.element.android.features.reportroom.test.FakeReportRoomEntryPoint
import io.element.android.features.roomdetails.api.RoomDetailsEntryPoint
import io.element.android.features.verifysession.api.OutgoingVerificationEntryPoint
import io.element.android.features.verifysession.test.FakeOutgoingVerificationEntryPoint
import io.element.android.libraries.matrix.api.core.EventId
import io.element.android.libraries.matrix.api.core.RoomId
import io.element.android.libraries.matrix.api.core.UserId
import io.element.android.libraries.matrix.api.permalink.PermalinkData
import io.element.android.libraries.matrix.api.room.JoinedRoom
import io.element.android.libraries.matrix.test.A_USER_ID
import io.element.android.libraries.matrix.test.room.FakeJoinedRoom
import io.element.android.libraries.mediaviewer.api.MediaGalleryEntryPoint
import io.element.android.libraries.mediaviewer.api.MediaViewerEntryPoint
import io.element.android.libraries.mediaviewer.test.FakeMediaGalleryEntryPoint
import io.element.android.libraries.mediaviewer.test.FakeMediaViewerEntryPoint
import io.element.android.services.analytics.test.FakeAnalyticsService
import io.element.android.tests.testutils.lambda.lambdaError
import io.element.android.tests.testutils.node.TestParentNode
@@ -52,76 +47,17 @@ class DefaultRoomDetailsEntryPointTest {
RoomDetailsFlowNode(
buildContext = buildContext,
plugins = plugins,
pollHistoryEntryPoint = object : PollHistoryEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext) = lambdaError()
},
elementCallEntryPoint = object : ElementCallEntryPoint {
override fun startCall(callType: CallType) = lambdaError()
override suspend fun handleIncomingCall(
callType: CallType.RoomCall,
eventId: EventId,
senderId: UserId,
roomName: String?,
senderName: String?,
avatarUrl: String?,
timestamp: Long,
expirationTimestamp: Long,
notificationChannelId: String,
textContent: String?
) = lambdaError()
},
pollHistoryEntryPoint = FakePollHistoryEntryPoint(),
elementCallEntryPoint = FakeElementCallEntryPoint(),
room = FakeJoinedRoom(),
analyticsService = FakeAnalyticsService(),
messagesEntryPoint = object : MessagesEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: MessagesEntryPoint.Params,
callback: MessagesEntryPoint.Callback,
) = lambdaError()
},
knockRequestsListEntryPoint = object : KnockRequestsListEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext) = lambdaError()
},
mediaViewerEntryPoint = object : MediaViewerEntryPoint {
override fun createParamsForAvatar(filename: String, avatarUrl: String) = lambdaError()
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: MediaViewerEntryPoint.Params,
callback: MediaViewerEntryPoint.Callback,
) = lambdaError()
},
mediaGalleryEntryPoint = object : MediaGalleryEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
callback: MediaGalleryEntryPoint.Callback,
) = lambdaError()
},
outgoingVerificationEntryPoint = object : OutgoingVerificationEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: OutgoingVerificationEntryPoint.Params,
callback: OutgoingVerificationEntryPoint.Callback,
) = lambdaError()
},
reportRoomEntryPoint = object : ReportRoomEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext, roomId: RoomId) = lambdaError()
},
changeRoomMemberRolesEntryPoint = object : ChangeRoomMemberRolesEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
room: JoinedRoom,
listType: ChangeRoomMemberRolesListType,
) = lambdaError()
},
messagesEntryPoint = FakeMessagesEntryPoint(),
knockRequestsListEntryPoint = FakeKnockRequestsListEntryPoint(),
mediaViewerEntryPoint = FakeMediaViewerEntryPoint(),
mediaGalleryEntryPoint = FakeMediaGalleryEntryPoint(),
outgoingVerificationEntryPoint = FakeOutgoingVerificationEntryPoint(),
reportRoomEntryPoint = FakeReportRoomEntryPoint(),
changeRoomMemberRolesEntryPoint = FakeChangeRoomMemberRolesEntryPoint(),
)
}
val callback = object : RoomDetailsEntryPoint.Callback {

View File

@@ -46,4 +46,5 @@ dependencies {
testImplementation(projects.libraries.matrix.test)
testImplementation(projects.libraries.mediaupload.test)
testImplementation(projects.libraries.preferences.test)
testImplementation(projects.libraries.roomselect.test)
}

View File

@@ -10,12 +10,11 @@ package io.element.android.features.share.impl
import android.content.Intent
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.features.share.api.ShareEntryPoint
import io.element.android.libraries.matrix.api.core.RoomId
import io.element.android.libraries.roomselect.api.RoomSelectEntryPoint
import io.element.android.libraries.roomselect.test.FakeRoomSelectEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
import io.element.android.tests.testutils.node.TestParentNode
import kotlinx.coroutines.test.runTest
@@ -37,14 +36,7 @@ class DefaultShareEntryPointTest {
buildContext = buildContext,
plugins = plugins,
presenterFactory = { createSharePresenter() },
roomSelectEntryPoint = object : RoomSelectEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: RoomSelectEntryPoint.Params,
callback: RoomSelectEntryPoint.Callback,
) = lambdaError()
},
roomSelectEntryPoint = FakeRoomSelectEntryPoint(),
)
}
val callback = object : ShareEntryPoint.Callback {

View File

@@ -51,6 +51,7 @@ dependencies {
testImplementation(projects.libraries.mediaupload.test)
testImplementation(projects.libraries.permissions.test)
testImplementation(projects.libraries.usersearch.test)
testImplementation(projects.features.createroom.test)
testImplementation(projects.features.startchat.test)
testImplementation(projects.libraries.featureflag.test)
}

View File

@@ -9,10 +9,9 @@ package io.element.android.features.startchat.impl
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.features.createroom.api.CreateRoomEntryPoint
import io.element.android.features.createroom.api.FakeCreateRoomEntryPoint
import io.element.android.features.startchat.api.StartChatEntryPoint
import io.element.android.libraries.matrix.api.core.RoomIdOrAlias
import io.element.android.tests.testutils.lambda.lambdaError
@@ -34,13 +33,7 @@ class DefaultStartChatEntryPointTest {
StartChatFlowNode(
buildContext = buildContext,
plugins = plugins,
createRoomEntryPoint = object : CreateRoomEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
callback: CreateRoomEntryPoint.Callback,
) = lambdaError()
},
createRoomEntryPoint = FakeCreateRoomEntryPoint(),
)
}
val callback = object : StartChatEntryPoint.Callback {

View File

@@ -44,6 +44,9 @@ dependencies {
testCommonDependencies(libs, true)
testImplementation(projects.libraries.matrix.test)
testImplementation(projects.libraries.mediaviewer.test)
testImplementation(projects.features.call.test)
testImplementation(projects.features.verifysession.test)
testImplementation(projects.features.startchat.test)
testImplementation(projects.features.enterprise.test)
}

View File

@@ -9,19 +9,15 @@ package io.element.android.features.userprofile.impl
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.features.call.api.CallType
import io.element.android.features.call.api.ElementCallEntryPoint
import io.element.android.features.call.test.FakeElementCallEntryPoint
import io.element.android.features.userprofile.api.UserProfileEntryPoint
import io.element.android.features.verifysession.api.OutgoingVerificationEntryPoint
import io.element.android.libraries.matrix.api.core.EventId
import io.element.android.features.verifysession.test.FakeOutgoingVerificationEntryPoint
import io.element.android.libraries.matrix.api.core.RoomId
import io.element.android.libraries.matrix.api.core.UserId
import io.element.android.libraries.matrix.test.A_SESSION_ID
import io.element.android.libraries.matrix.test.A_USER_ID
import io.element.android.libraries.mediaviewer.api.MediaViewerEntryPoint
import io.element.android.libraries.mediaviewer.test.FakeMediaViewerEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
import io.element.android.tests.testutils.node.TestParentNode
import org.junit.Rule
@@ -43,38 +39,9 @@ class DefaultUserProfileEntryPointTest {
buildContext = buildContext,
plugins = plugins,
sessionId = A_SESSION_ID,
elementCallEntryPoint = object : ElementCallEntryPoint {
override fun startCall(callType: CallType) = lambdaError()
override suspend fun handleIncomingCall(
callType: CallType.RoomCall,
eventId: EventId,
senderId: UserId,
roomName: String?,
senderName: String?,
avatarUrl: String?,
timestamp: Long,
expirationTimestamp: Long,
notificationChannelId: String,
textContent: String?
) = lambdaError()
},
mediaViewerEntryPoint = object : MediaViewerEntryPoint {
override fun createParamsForAvatar(filename: String, avatarUrl: String) = lambdaError()
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: MediaViewerEntryPoint.Params,
callback: MediaViewerEntryPoint.Callback
) = lambdaError()
},
outgoingVerificationEntryPoint = object : OutgoingVerificationEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: OutgoingVerificationEntryPoint.Params,
callback: OutgoingVerificationEntryPoint.Callback,
) = lambdaError()
},
elementCallEntryPoint = FakeElementCallEntryPoint(),
mediaViewerEntryPoint = FakeMediaViewerEntryPoint(),
outgoingVerificationEntryPoint = FakeOutgoingVerificationEntryPoint(),
)
}
val callback = object : UserProfileEntryPoint.Callback {

View File

@@ -0,0 +1,20 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.features.verifysession.test"
}
dependencies {
implementation(projects.features.verifysession.api)
implementation(projects.libraries.architecture)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.verifysession.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.verifysession.api.IncomingVerificationEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeIncomingVerificationEntryPoint : IncomingVerificationEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: IncomingVerificationEntryPoint.Params,
callback: IncomingVerificationEntryPoint.Callback,
): Node = lambdaError()
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.verifysession.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.verifysession.api.OutgoingVerificationEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeOutgoingVerificationEntryPoint : OutgoingVerificationEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: OutgoingVerificationEntryPoint.Params,
callback: OutgoingVerificationEntryPoint.Callback,
): Node = lambdaError()
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.features.viewfolder.test"
}
dependencies {
implementation(projects.features.viewfolder.api)
implementation(projects.libraries.architecture)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.features.viewfolder.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.viewfolder.api.ViewFolderEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeViewFolderEntryPoint : ViewFolderEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: ViewFolderEntryPoint.Params,
callback: ViewFolderEntryPoint.Callback,
): Node = lambdaError()
}

View File

@@ -9,13 +9,12 @@ package io.element.android.libraries.mediaviewer.impl
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import io.element.android.libraries.matrix.api.core.EventId
import io.element.android.libraries.mediaviewer.api.MediaGalleryEntryPoint
import io.element.android.libraries.mediaviewer.api.MediaViewerEntryPoint
import io.element.android.libraries.mediaviewer.impl.gallery.root.MediaGalleryFlowNode
import io.element.android.libraries.mediaviewer.test.FakeMediaViewerEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
import io.element.android.tests.testutils.node.TestParentNode
import org.junit.Rule
@@ -35,15 +34,7 @@ class DefaultMediaGalleryEntryPointTest {
MediaGalleryFlowNode(
buildContext = buildContext,
plugins = plugins,
mediaViewerEntryPoint = object : MediaViewerEntryPoint {
override fun createParamsForAvatar(filename: String, avatarUrl: String) = lambdaError()
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: MediaViewerEntryPoint.Params,
callback: MediaViewerEntryPoint.Callback,
) = lambdaError()
},
mediaViewerEntryPoint = FakeMediaViewerEntryPoint(),
)
}
val callback = object : MediaGalleryEntryPoint.Callback {

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.mediaviewer.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.libraries.mediaviewer.api.MediaGalleryEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeMediaGalleryEntryPoint : MediaGalleryEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
callback: MediaGalleryEntryPoint.Callback,
): Node = lambdaError()
}

View File

@@ -0,0 +1,24 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.mediaviewer.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.libraries.mediaviewer.api.MediaViewerEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeMediaViewerEntryPoint : MediaViewerEntryPoint {
override fun createParamsForAvatar(filename: String, avatarUrl: String) = lambdaError()
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: MediaViewerEntryPoint.Params,
callback: MediaViewerEntryPoint.Callback,
): Node = lambdaError()
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.libraries.roomselect.test"
}
dependencies {
implementation(projects.libraries.architecture)
implementation(projects.libraries.roomselect.api)
implementation(projects.tests.testutils)
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.roomselect.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.libraries.roomselect.api.RoomSelectEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeRoomSelectEntryPoint : RoomSelectEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: RoomSelectEntryPoint.Params,
callback: RoomSelectEntryPoint.Callback,
): Node = lambdaError()
}

View File

@@ -13,6 +13,7 @@ android {
}
dependencies {
implementation(projects.libraries.architecture)
implementation(projects.libraries.troubleshoot.api)
implementation(projects.tests.testutils)
implementation(libs.coroutines.test)

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.troubleshoot.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.libraries.troubleshoot.api.NotificationTroubleShootEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeNotificationTroubleShootEntryPoint : NotificationTroubleShootEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
callback: NotificationTroubleShootEntryPoint.Callback,
): Node = lambdaError()
}

View File

@@ -0,0 +1,21 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.troubleshoot.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.libraries.troubleshoot.api.PushHistoryEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakePushHistoryEntryPoint : PushHistoryEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
callback: PushHistoryEntryPoint.Callback,
): Node = lambdaError()
}