Remove context(parentNode: Node) and provide the parent Node as a parameter.
This commit is contained in:
parent
f1822c5afd
commit
07b6148035
161 changed files with 668 additions and 436 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue