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

Loading…
Cancel
Save