mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 11:30:20 +00:00
Use context parameter for the parentNode
This commit is contained in:
committed by
Benoit Marty
parent
02dc71c4c3
commit
f174084942
+1
-1
@@ -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,
|
||||
|
||||
+14
-12
@@ -37,12 +37,13 @@ class DefaultLockScreenEntryPointTest {
|
||||
override fun onSetupDone() = lambdaError()
|
||||
}
|
||||
val navTarget = LockScreenEntryPoint.Target.Setup
|
||||
val result = entryPoint.createNode(
|
||||
parentNode = parentNode,
|
||||
buildContext = BuildContext.root(null),
|
||||
navTarget = navTarget,
|
||||
callback = callback,
|
||||
)
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(
|
||||
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)
|
||||
@@ -61,12 +62,13 @@ class DefaultLockScreenEntryPointTest {
|
||||
override fun onSetupDone() = lambdaError()
|
||||
}
|
||||
val navTarget = LockScreenEntryPoint.Target.Settings
|
||||
val result = entryPoint.createNode(
|
||||
parentNode = parentNode,
|
||||
buildContext = BuildContext.root(null),
|
||||
navTarget = navTarget,
|
||||
callback = callback,
|
||||
)
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user