mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Remove context(parentNode: Node) and provide the parent Node as a parameter.
This commit is contained in:
+5
-2
@@ -16,8 +16,11 @@ import io.element.android.libraries.architecture.createNode
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultSignedOutEntryPoint : SignedOutEntryPoint {
|
||||
context(parentNode: Node)
|
||||
override fun createNode(buildContext: BuildContext, params: SignedOutEntryPoint.Params): Node {
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
params: SignedOutEntryPoint.Params,
|
||||
): Node {
|
||||
return parentNode.createNode<SignedOutNode>(
|
||||
buildContext = buildContext,
|
||||
plugins = listOf(SignedOutNode.Inputs(params.sessionId))
|
||||
|
||||
+5
-6
@@ -34,12 +34,11 @@ class DefaultSignedOutEntryPointTest {
|
||||
)
|
||||
}
|
||||
val params = SignedOutEntryPoint.Params(A_SESSION_ID)
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(
|
||||
buildContext = BuildContext.root(null),
|
||||
params = params,
|
||||
)
|
||||
}
|
||||
val result = entryPoint.createNode(
|
||||
parentNode = parentNode,
|
||||
buildContext = BuildContext.root(null),
|
||||
params = params,
|
||||
)
|
||||
assertThat(result).isInstanceOf(SignedOutNode::class.java)
|
||||
assertThat(result.plugins).contains(SignedOutNode.Inputs(params.sessionId))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user