Remove context(parentNode: Node) and provide the parent Node as a parameter.
This commit is contained in:
+6
-2
@@ -17,8 +17,12 @@ import io.element.android.libraries.architecture.createNode
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultViewFolderEntryPoint : ViewFolderEntryPoint {
|
||||
context(parentNode: Node)
|
||||
override fun createNode(buildContext: BuildContext, params: ViewFolderEntryPoint.Params, callback: ViewFolderEntryPoint.Callback): Node {
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
params: ViewFolderEntryPoint.Params,
|
||||
callback: ViewFolderEntryPoint.Callback,
|
||||
): Node {
|
||||
return parentNode.createNode<ViewFolderFlowNode>(
|
||||
buildContext = buildContext,
|
||||
plugins = listOf(
|
||||
|
||||
+6
-7
@@ -40,13 +40,12 @@ class DefaultViewFolderEntryPointTest {
|
||||
val params = ViewFolderEntryPoint.Params(
|
||||
rootPath = "path",
|
||||
)
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(
|
||||
buildContext = BuildContext.root(null),
|
||||
params = params,
|
||||
callback = callback,
|
||||
)
|
||||
}
|
||||
val result = entryPoint.createNode(
|
||||
parentNode = parentNode,
|
||||
buildContext = BuildContext.root(null),
|
||||
params = params,
|
||||
callback = callback,
|
||||
)
|
||||
assertThat(result).isInstanceOf(ViewFolderFlowNode::class.java)
|
||||
assertThat(result.plugins).contains(ViewFolderFlowNode.Inputs(params.rootPath))
|
||||
assertThat(result.plugins).contains(callback)
|
||||
|
||||
Reference in New Issue
Block a user