diff options
author | Robert Jaros <rjaros@finn.pl> | 2017-10-28 23:45:26 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2017-10-28 23:45:26 +0200 |
commit | 06f297d68887c7934e66d2c757abc8bf619df66a (patch) | |
tree | a828eec09f0bdc99b0f3fd45972b8cead37fbdec /src/test | |
parent | 6b13b8909a302b0f0f2155b81b83cd5ab4d7a046 (diff) | |
download | kvision-06f297d68887c7934e66d2c757abc8bf619df66a.tar.gz kvision-06f297d68887c7934e66d2c757abc8bf619df66a.tar.bz2 kvision-06f297d68887c7934e66d2c757abc8bf619df66a.zip |
Databinding components
Event handlers refactoring
Diffstat (limited to 'src/test')
3 files changed, 19 insertions, 19 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/core/ContainerSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/core/ContainerSpec.kt index c39aeb75..a169ace6 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/core/ContainerSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/core/ContainerSpec.kt @@ -1,6 +1,6 @@ package test.pl.treksoft.kvision.core -import pl.treksoft.kvision.core.Container +import pl.treksoft.kvision.panel.SimplePanel import pl.treksoft.kvision.core.Root import pl.treksoft.kvision.core.Widget import test.pl.treksoft.kvision.DomSpec @@ -14,7 +14,7 @@ class ContainerSpec : DomSpec { fun add() { run { val root = Root("test") - val container = Container() + val container = SimplePanel() val child1 = Widget() child1.id = "child1" val child2 = Widget() @@ -24,7 +24,7 @@ class ContainerSpec : DomSpec { root.add(container) val elem1 = document.getElementById("child1") val elem2 = document.getElementById("child2") - assertTrue("Container renders children") { elem1 != null && elem2 != null } + assertTrue("SimplePanel renders children") { elem1 != null && elem2 != null } } } @@ -32,7 +32,7 @@ class ContainerSpec : DomSpec { fun addAll() { run { val root = Root("test") - val container = Container() + val container = SimplePanel() val child1 = Widget() child1.id = "child1" val child2 = Widget() @@ -41,7 +41,7 @@ class ContainerSpec : DomSpec { root.add(container) val elem1 = document.getElementById("child1") val elem2 = document.getElementById("child2") - assertTrue("Container renders children") { elem1 != null && elem2 != null } + assertTrue("SimplePanel renders children") { elem1 != null && elem2 != null } } } @@ -49,7 +49,7 @@ class ContainerSpec : DomSpec { fun remove() { run { val root = Root("test") - val container = Container() + val container = SimplePanel() val child1 = Widget() child1.id = "child1" val child2 = Widget() @@ -60,7 +60,7 @@ class ContainerSpec : DomSpec { container.remove(child2) val elem1 = document.getElementById("child1") val elem2 = document.getElementById("child2") - assertTrue("Container renders children") { elem1 != null && elem2 == null } + assertTrue("SimplePanel renders children") { elem1 != null && elem2 == null } } } @@ -68,7 +68,7 @@ class ContainerSpec : DomSpec { fun removeAll() { run { val root = Root("test") - val container = Container() + val container = SimplePanel() val child1 = Widget() child1.id = "child1" val child2 = Widget() @@ -86,7 +86,7 @@ class ContainerSpec : DomSpec { fun getChildren() { run { val root = Root("test") - val container = Container() + val container = SimplePanel() val child1 = Widget() child1.id = "child1" val child2 = Widget() diff --git a/src/test/kotlin/test/pl/treksoft/kvision/core/KVManagerSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/core/KVManagerSpec.kt index f47e1900..307ebd67 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/core/KVManagerSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/core/KVManagerSpec.kt @@ -20,8 +20,8 @@ class KVManagerSpec : DomSpec { style = snStyle(listOf("fontWeight" to "bold", "fontStyle" to "italic")) }) KVManager.patch("test", vnode) - assertTrue("Original container should not exist") { document.getElementById("test") == null } - assertTrue("New container should exist") { document.getElementById("test_new") != null } + assertTrue("Original child should not exist") { document.getElementById("test") == null } + assertTrue("New child should exist") { document.getElementById("test_new") != null } } } @@ -38,9 +38,9 @@ class KVManagerSpec : DomSpec { style = snStyle(listOf("fontWeight" to "bold", "fontStyle" to "italic")) }) KVManager.patch(vnode2, vnode3) - assertTrue("First container should not exist") { document.getElementById("test") == null } - assertTrue("Second container should not exist") { document.getElementById("test2") == null } - assertTrue("Third container should exist") { document.getElementById("test3") != null } + assertTrue("First child should not exist") { document.getElementById("test") == null } + assertTrue("Second child should not exist") { document.getElementById("test2") == null } + assertTrue("Third child should exist") { document.getElementById("test3") != null } } } @@ -49,10 +49,10 @@ class KVManagerSpec : DomSpec { run { val node = KVManager.virtualize("<div id=\"virtual\"><p>Virtual node</p></div>") KVManager.patch("test", node) - assertTrue("Original container should not exist") { document.getElementById("test") == null } + assertTrue("Original child should not exist") { document.getElementById("test") == null } val v = document.getElementById("virtual") - assertTrue("New container should exist") { v != null } - assertTrue("New container should have one child") { v?.children?.length == 1 } + assertTrue("New child should exist") { v != null } + assertTrue("New child should have one child") { v?.children?.length == 1 } } } } diff --git a/src/test/kotlin/test/pl/treksoft/kvision/core/RootSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/core/RootSpec.kt index 6407dbc3..9895c16d 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/core/RootSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/core/RootSpec.kt @@ -14,7 +14,7 @@ class RootSpec : DomSpec { run { Root("test") val rootElem = document.getElementById("test") - assertTrue("Standard root container has correct css class") { rootElem?.className == "container-fluid" } + assertTrue("Standard root child has correct css class") { rootElem?.className == "container-fluid" } } } @@ -23,7 +23,7 @@ class RootSpec : DomSpec { run { Root("test", fixed = true) val rootElem = document.getElementById("test") - assertTrue("Fluid root container has correct css class") { rootElem?.className == "container" } + assertTrue("Fluid root child has correct css class") { rootElem?.className == "container" } } } |