Use context parameter for the parentNode

This commit is contained in:
Benoit Marty 2025-10-30 13:02:20 +01:00 committed by Benoit Marty
parent 566515ca88
commit 05c5f3c914
138 changed files with 450 additions and 375 deletions

View file

@ -18,8 +18,8 @@ import io.element.android.libraries.matrix.api.room.JoinedRoom
@ContributesBinding(SessionScope::class)
class DefaultChangeRoomMemberRolesEntyPoint : ChangeRoomMemberRolesEntryPoint {
context(parentNode: Node)
override fun createNode(
parentNode: Node,
buildContext: BuildContext,
room: JoinedRoom,
listType: ChangeRoomMemberRolesListType,

View file

@ -31,12 +31,13 @@ class DefaultChangeRoomMemberRolesEntyPointTest {
}
val room = FakeJoinedRoom()
val listType = ChangeRoomMemberRolesListType.Admins
val result = entryPoint.createNode(
parentNode = parentNode,
buildContext = BuildContext.root(null),
room = FakeJoinedRoom(),
listType = listType,
)
val result = with(parentNode) {
entryPoint.createNode(
buildContext = BuildContext.root(null),
room = FakeJoinedRoom(),
listType = listType,
)
}
assertThat(result).isInstanceOf(ChangeRoomMemberRolesRootNode::class.java)
// Search for the Inputs plugin
val input = result.plugins.filterIsInstance<ChangeRoomMemberRolesRootNode.Inputs>().single()