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 02dc71c4c3
commit f174084942
138 changed files with 450 additions and 375 deletions

View file

@ -16,7 +16,8 @@ import io.element.android.libraries.architecture.createNode
@ContributesBinding(AppScope::class)
class DefaultSignedOutEntryPoint : SignedOutEntryPoint {
override fun createNode(parentNode: Node, buildContext: BuildContext, params: SignedOutEntryPoint.Params): Node {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext, params: SignedOutEntryPoint.Params): Node {
return parentNode.createNode<SignedOutNode>(
buildContext = buildContext,
plugins = listOf(SignedOutNode.Inputs(params.sessionId))

View file

@ -34,11 +34,12 @@ class DefaultSignedOutEntryPointTest {
)
}
val params = SignedOutEntryPoint.Params(A_SESSION_ID)
val result = entryPoint.createNode(
parentNode = parentNode,
buildContext = BuildContext.root(null),
params = params,
)
val result = with(parentNode) {
entryPoint.createNode(
buildContext = BuildContext.root(null),
params = params,
)
}
assertThat(result).isInstanceOf(SignedOutNode::class.java)
assertThat(result.plugins).contains(SignedOutNode.Inputs(params.sessionId))
}