Browse Source

Update test with multiple onDispose calls

with_mpp_example
Shagen Ogandzhanian 3 years ago
parent
commit
6032f005ea
  1. 31
      web/core/src/jsTest/kotlin/DomSideEffectTests.kt

31
web/core/src/jsTest/kotlin/DomSideEffectTests.kt

@ -119,9 +119,31 @@ class DomSideEffectTests {
Div {
DomSideEffect(key) {
effectsList.add("DomSideEffect")
onDispose {
effectsList.add("DomSideEffectIgnored")
}
onDispose {
throw Exception("this should be ignored")
}
onDispose {
effectsList.add("DomSideEffectDisposed")
}
}
DisposableRefEffect(key) {
effectsList.add("DisposableRefEffect")
onDispose {
effectsList.add("DisposableRefEffectIgnored")
}
onDispose {
throw Exception("this should be ignored")
}
onDispose {
effectsList.add("DisposableRefEffectDisposed")
}
@ -140,7 +162,14 @@ class DomSideEffectTests {
waitForRecompositionComplete()
assertContentEquals(
listOf("DisposableRefEffect", "DomSideEffect", "DisposableRefEffectDisposed", "DisposableRefEffect", "DomSideEffect"),
listOf(
"DisposableRefEffect",
"DomSideEffect",
"DisposableRefEffectDisposed",
"DomSideEffectDisposed",
"DisposableRefEffect",
"DomSideEffect"
),
effectsList
)
}

Loading…
Cancel
Save