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
|
|
@ -19,8 +19,8 @@ import io.element.android.libraries.architecture.createNode
|
|||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultLockScreenEntryPoint : LockScreenEntryPoint {
|
||||
context(parentNode: Node)
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
navTarget: LockScreenEntryPoint.Target,
|
||||
callback: LockScreenEntryPoint.Callback,
|
||||
|
|
|
|||
|
|
@ -37,13 +37,12 @@ class DefaultLockScreenEntryPointTest {
|
|||
override fun onSetupDone() = lambdaError()
|
||||
}
|
||||
val navTarget = LockScreenEntryPoint.Target.Setup
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(
|
||||
buildContext = BuildContext.root(null),
|
||||
navTarget = navTarget,
|
||||
callback = callback,
|
||||
)
|
||||
}
|
||||
val result = entryPoint.createNode(
|
||||
parentNode = parentNode,
|
||||
buildContext = BuildContext.root(null),
|
||||
navTarget = navTarget,
|
||||
callback = callback,
|
||||
)
|
||||
assertThat(result).isInstanceOf(LockScreenFlowNode::class.java)
|
||||
assertThat(result.plugins).contains(LockScreenFlowNode.Inputs(LockScreenFlowNode.NavTarget.Setup))
|
||||
assertThat(result.plugins).contains(callback)
|
||||
|
|
@ -62,13 +61,12 @@ class DefaultLockScreenEntryPointTest {
|
|||
override fun onSetupDone() = lambdaError()
|
||||
}
|
||||
val navTarget = LockScreenEntryPoint.Target.Settings
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(
|
||||
buildContext = BuildContext.root(null),
|
||||
navTarget = navTarget,
|
||||
callback = callback,
|
||||
)
|
||||
}
|
||||
val result = entryPoint.createNode(
|
||||
parentNode = parentNode,
|
||||
buildContext = BuildContext.root(null),
|
||||
navTarget = navTarget,
|
||||
callback = callback,
|
||||
)
|
||||
assertThat(result).isInstanceOf(LockScreenFlowNode::class.java)
|
||||
assertThat(result.plugins).contains(LockScreenFlowNode.Inputs(LockScreenFlowNode.NavTarget.Settings))
|
||||
assertThat(result.plugins).contains(callback)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue