aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/kotlin')
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/FooterSpec.kt43
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/H1Spec.kt43
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/H2Spec.kt43
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/H3Spec.kt43
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/H4Spec.kt43
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/H5Spec.kt43
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/H6Spec.kt43
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/HeaderSpec.kt43
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/PSpec.kt43
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/SectionSpec.kt47
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/SpanSpec.kt (renamed from src/test/kotlin/test/pl/treksoft/kvision/html/LabelSpec.kt)10
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/DockPanelSpec.kt12
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/FlexPanelSpec.kt8
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/GridPanelSpec.kt8
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/HPanelSpec.kt8
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/ResponsiveGridPanelSpec.kt8
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/SplitPanelSpec.kt6
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/StackPanelSpec.kt18
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/TabPanelSpec.kt14
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt8
20 files changed, 484 insertions, 50 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/FooterSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/FooterSpec.kt
new file mode 100644
index 00000000..6398d95c
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/FooterSpec.kt
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package test.pl.treksoft.kvision.html
+
+import pl.treksoft.kvision.html.Footer
+import pl.treksoft.kvision.panel.Root
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class FooterSpec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val footer = Footer("This is a footer")
+ root.add(footer)
+ val element = document.getElementById("test")
+ assertEqualsHtml("<footer>This is a footer</footer>", element?.innerHTML, "Should render correct footer")
+ }
+ }
+
+}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/H1Spec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/H1Spec.kt
new file mode 100644
index 00000000..6f22b89f
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/H1Spec.kt
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package test.pl.treksoft.kvision.html
+
+import pl.treksoft.kvision.html.H1
+import pl.treksoft.kvision.panel.Root
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class H1Spec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val h1 = H1("This is h1 header")
+ root.add(h1)
+ val element = document.getElementById("test")
+ assertEqualsHtml("<h1>This is h1 header</h1>", element?.innerHTML, "Should render correct h1")
+ }
+ }
+
+}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/H2Spec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/H2Spec.kt
new file mode 100644
index 00000000..1ca74077
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/H2Spec.kt
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package test.pl.treksoft.kvision.html
+
+import pl.treksoft.kvision.html.H2
+import pl.treksoft.kvision.panel.Root
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class H2Spec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val h2 = H2("This is h2 header")
+ root.add(h2)
+ val element = document.getElementById("test")
+ assertEqualsHtml("<h2>This is h2 header</h2>", element?.innerHTML, "Should render correct h2")
+ }
+ }
+
+}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/H3Spec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/H3Spec.kt
new file mode 100644
index 00000000..a9f58473
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/H3Spec.kt
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package test.pl.treksoft.kvision.html
+
+import pl.treksoft.kvision.html.H3
+import pl.treksoft.kvision.panel.Root
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class H3Spec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val h3 = H3("This is h3 header")
+ root.add(h3)
+ val element = document.getElementById("test")
+ assertEqualsHtml("<h3>This is h3 header</h3>", element?.innerHTML, "Should render correct h3")
+ }
+ }
+
+}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/H4Spec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/H4Spec.kt
new file mode 100644
index 00000000..47550459
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/H4Spec.kt
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package test.pl.treksoft.kvision.html
+
+import pl.treksoft.kvision.html.H4
+import pl.treksoft.kvision.panel.Root
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class H4Spec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val h4 = H4("This is h4 header")
+ root.add(h4)
+ val element = document.getElementById("test")
+ assertEqualsHtml("<h4>This is h4 header</h4>", element?.innerHTML, "Should render correct h4")
+ }
+ }
+
+}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/H5Spec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/H5Spec.kt
new file mode 100644
index 00000000..6b3fc647
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/H5Spec.kt
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package test.pl.treksoft.kvision.html
+
+import pl.treksoft.kvision.html.H5
+import pl.treksoft.kvision.panel.Root
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class H5Spec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val h5 = H5("This is h5 header")
+ root.add(h5)
+ val element = document.getElementById("test")
+ assertEqualsHtml("<h5>This is h5 header</h5>", element?.innerHTML, "Should render correct h5")
+ }
+ }
+
+}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/H6Spec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/H6Spec.kt
new file mode 100644
index 00000000..e22bd401
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/H6Spec.kt
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package test.pl.treksoft.kvision.html
+
+import pl.treksoft.kvision.html.H1
+import pl.treksoft.kvision.panel.Root
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class H6Spec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val div = H1("This is h1 header")
+ root.add(div)
+ val element = document.getElementById("test")
+ assertEqualsHtml("<h1>This is h1 header</h1>", element?.innerHTML, "Should render correct h1")
+ }
+ }
+
+}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/HeaderSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/HeaderSpec.kt
new file mode 100644
index 00000000..e5ea8679
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/HeaderSpec.kt
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package test.pl.treksoft.kvision.html
+
+import pl.treksoft.kvision.html.Header
+import pl.treksoft.kvision.panel.Root
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class HeaderSpec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val header = Header("This is a header")
+ root.add(header)
+ val element = document.getElementById("test")
+ assertEqualsHtml("<header>This is a header</header>", element?.innerHTML, "Should render correct header")
+ }
+ }
+
+}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/PSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/PSpec.kt
new file mode 100644
index 00000000..d5af81e3
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/PSpec.kt
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package test.pl.treksoft.kvision.html
+
+import pl.treksoft.kvision.html.P
+import pl.treksoft.kvision.panel.Root
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class PSpec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val par = P("This is a paragraph")
+ root.add(par)
+ val element = document.getElementById("test")
+ assertEqualsHtml("<p>This is a paragraph</p>", element?.innerHTML, "Should render correct paragraph")
+ }
+ }
+
+}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/SectionSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/SectionSpec.kt
new file mode 100644
index 00000000..4fb7a490
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/SectionSpec.kt
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package test.pl.treksoft.kvision.html
+
+import pl.treksoft.kvision.html.Section
+import pl.treksoft.kvision.panel.Root
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class SectionSpec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val section = Section("This is a section")
+ root.add(section)
+ val element = document.getElementById("test")
+ assertEqualsHtml(
+ "<section>This is a section</section>",
+ element?.innerHTML,
+ "Should render correct section"
+ )
+ }
+ }
+
+}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/LabelSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/SpanSpec.kt
index a9f06349..b1f49b45 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/html/LabelSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/SpanSpec.kt
@@ -21,22 +21,22 @@
*/
package test.pl.treksoft.kvision.html
-import pl.treksoft.kvision.html.Label
+import pl.treksoft.kvision.html.Span
import pl.treksoft.kvision.panel.Root
import test.pl.treksoft.kvision.DomSpec
import kotlin.browser.document
import kotlin.test.Test
-class LabelSpec : DomSpec {
+class SpanSpec : DomSpec {
@Test
fun render() {
run {
val root = Root("test", true)
- val label = Label("This is a label")
- root.add(label)
+ val span = Span("This is a label")
+ root.add(span)
val element = document.getElementById("test")
- assertEqualsHtml("<span>This is a label</span>", element?.innerHTML, "Should render correct label")
+ assertEqualsHtml("<span>This is a label</span>", element?.innerHTML, "Should render correct span")
}
}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/panel/DockPanelSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/panel/DockPanelSpec.kt
index de4cf43d..d387be56 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/panel/DockPanelSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/DockPanelSpec.kt
@@ -21,7 +21,7 @@
*/
package test.pl.treksoft.kvision.panel
-import pl.treksoft.kvision.html.Label
+import pl.treksoft.kvision.html.Span
import pl.treksoft.kvision.panel.DockPanel
import pl.treksoft.kvision.panel.Root
import pl.treksoft.kvision.panel.Side
@@ -37,11 +37,11 @@ class DockPanelSpec : DomSpec {
val root = Root("test", true)
val dockPanel = DockPanel()
root.add(dockPanel)
- dockPanel.add(Label("abc"), Side.UP)
- dockPanel.add(Label("def"), Side.RIGHT)
- dockPanel.add(Label("ghi"), Side.DOWN)
- dockPanel.add(Label("jkl"), Side.LEFT)
- dockPanel.add(Label("mno"), Side.CENTER)
+ dockPanel.add(Span("abc"), Side.UP)
+ dockPanel.add(Span("def"), Side.RIGHT)
+ dockPanel.add(Span("ghi"), Side.DOWN)
+ dockPanel.add(Span("jkl"), Side.LEFT)
+ dockPanel.add(Span("mno"), Side.CENTER)
val element = document.getElementById("test")
assertEqualsHtml(
"<div><div style=\"width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch;\"><div style=\"order: 2; flex-grow: 1; flex-basis: 0%;\"><div style=\"width: 100%; height: 100%; display: flex; justify-content: space-between; align-items: stretch;\"><div style=\"order: 3; flex-basis: 0%;\"><span>def</span></div><div style=\"order: 1; flex-basis: 0%;\"><span>jkl</span></div><div style=\"order: 2; flex-grow: 1; flex-basis: 0%;\"><span>mno</span></div></div></div><div style=\"order: 1; flex-basis: 0%;\"><span>abc</span></div><div style=\"order: 3; flex-basis: 0%;\"><span>ghi</span></div></div></div>",
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/panel/FlexPanelSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/panel/FlexPanelSpec.kt
index d9074dae..5bcc68f6 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/panel/FlexPanelSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/FlexPanelSpec.kt
@@ -21,7 +21,7 @@
*/
package test.pl.treksoft.kvision.panel
-import pl.treksoft.kvision.html.Label
+import pl.treksoft.kvision.html.Span
import pl.treksoft.kvision.panel.FlexDir
import pl.treksoft.kvision.panel.FlexJustify
import pl.treksoft.kvision.panel.FlexPanel
@@ -38,9 +38,9 @@ class FlexPanelSpec : DomSpec {
val root = Root("test", true)
val flexPanel = FlexPanel(FlexDir.ROWREV, justify = FlexJustify.SPACEEVENLY)
root.add(flexPanel)
- flexPanel.add(Label("abc"), 1)
- flexPanel.add(Label("def"), 2)
- flexPanel.add(Label("ghi"), 3)
+ flexPanel.add(Span("abc"), 1)
+ flexPanel.add(Span("def"), 2)
+ flexPanel.add(Span("ghi"), 3)
val element = document.getElementById("test")
assertEqualsHtml(
"<div style=\"display: flex; flex-direction: row-reverse; justify-content: space-evenly;\"><div style=\"order: 1;\"><span>abc</span></div><div style=\"order: 2;\"><span>def</span></div><div style=\"order: 3;\"><span>ghi</span></div></div>",
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/panel/GridPanelSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/panel/GridPanelSpec.kt
index f244b02f..add3638f 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/panel/GridPanelSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/GridPanelSpec.kt
@@ -21,7 +21,7 @@
*/
package test.pl.treksoft.kvision.panel
-import pl.treksoft.kvision.html.Label
+import pl.treksoft.kvision.html.Span
import pl.treksoft.kvision.panel.GridPanel
import pl.treksoft.kvision.panel.Root
import test.pl.treksoft.kvision.DomSpec
@@ -36,9 +36,9 @@ class GridPanelSpec : DomSpec {
val root = Root("test", true)
val gridPanel = GridPanel()
root.add(gridPanel)
- gridPanel.add(Label("abc"), 1, 1)
- gridPanel.add(Label("def"), 2, 2)
- gridPanel.add(Label("ghi"), 3, 3)
+ gridPanel.add(Span("abc"), 1, 1)
+ gridPanel.add(Span("def"), 2, 2)
+ gridPanel.add(Span("ghi"), 3, 3)
val element = document.getElementById("test")
assertEqualsHtml(
"<div style=\"display: grid;\"><div style=\"grid-column-start: 1; grid-row-start: 1;\"><span>abc</span></div><div style=\"grid-column-start: 2; grid-row-start: 2;\"><span>def</span></div><div style=\"grid-column-start: 3; grid-row-start: 3;\"><span>ghi</span></div></div>",
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/panel/HPanelSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/panel/HPanelSpec.kt
index da403d44..a185420c 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/panel/HPanelSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/HPanelSpec.kt
@@ -21,7 +21,7 @@
*/
package test.pl.treksoft.kvision.panel
-import pl.treksoft.kvision.html.Label
+import pl.treksoft.kvision.html.Span
import pl.treksoft.kvision.panel.FlexJustify
import pl.treksoft.kvision.panel.HPanel
import pl.treksoft.kvision.panel.Root
@@ -37,9 +37,9 @@ class HPanelSpec : DomSpec {
val root = Root("test", true)
val hPanel = HPanel(justify = FlexJustify.SPACEBETWEEN)
root.add(hPanel)
- hPanel.add(Label("abc"), 1)
- hPanel.add(Label("def"), 2)
- hPanel.add(Label("ghi"), 3)
+ hPanel.add(Span("abc"), 1)
+ hPanel.add(Span("def"), 2)
+ hPanel.add(Span("ghi"), 3)
val element = document.getElementById("test")
assertEqualsHtml(
"<div style=\"display: flex; justify-content: space-between;\"><div style=\"order: 1;\"><span>abc</span></div><div style=\"order: 2;\"><span>def</span></div><div style=\"order: 3;\"><span>ghi</span></div></div>",
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/panel/ResponsiveGridPanelSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/panel/ResponsiveGridPanelSpec.kt
index b2e2d4e3..eb710cef 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/panel/ResponsiveGridPanelSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/ResponsiveGridPanelSpec.kt
@@ -21,7 +21,7 @@
*/
package test.pl.treksoft.kvision.panel
-import pl.treksoft.kvision.html.Label
+import pl.treksoft.kvision.html.Span
import pl.treksoft.kvision.panel.ResponsiveGridPanel
import pl.treksoft.kvision.panel.Root
import test.pl.treksoft.kvision.DomSpec
@@ -36,9 +36,9 @@ class ResponsiveGridPanelSpec : DomSpec {
val root = Root("test", true)
val rgPanel = ResponsiveGridPanel()
root.add(rgPanel)
- rgPanel.add(Label("abc"), 1, 1)
- rgPanel.add(Label("def"), 2, 2)
- rgPanel.add(Label("ghi"), 3, 3)
+ rgPanel.add(Span("abc"), 1, 1)
+ rgPanel.add(Span("def"), 2, 2)
+ rgPanel.add(Span("ghi"), 3, 3)
val element = document.getElementById("test")
assertEqualsHtml(
"<div class=\"container-fluid\"><div class=\"row\"></div><div class=\"row\"><div class=\"col-md-3\"></div><div class=\"col-md-3\"><span>abc</span></div><div class=\"col-md-3\"></div><div class=\"col-md-3\"></div></div><div class=\"row\"><div class=\"col-md-3\"></div><div class=\"col-md-3\"></div><div class=\"col-md-3\"><span>def</span></div><div class=\"col-md-3\"></div></div><div class=\"row\"><div class=\"col-md-3\"></div><div class=\"col-md-3\"></div><div class=\"col-md-3\"></div><div class=\"col-md-3\"><span>ghi</span></div></div></div>",
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/panel/SplitPanelSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/panel/SplitPanelSpec.kt
index bbe95f30..09c397ce 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/panel/SplitPanelSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/SplitPanelSpec.kt
@@ -21,7 +21,7 @@
*/
package test.pl.treksoft.kvision.panel
-import pl.treksoft.kvision.html.Label
+import pl.treksoft.kvision.html.Span
import pl.treksoft.kvision.panel.Direction
import pl.treksoft.kvision.panel.Root
import pl.treksoft.kvision.panel.SplitPanel
@@ -37,8 +37,8 @@ class SplitPanelSpec : DomSpec {
val root = Root("test", true)
val splitPanel = SplitPanel(Direction.VERTICAL)
root.add(splitPanel)
- val label1 = Label("abc")
- val label2 = Label("def")
+ val label1 = Span("abc")
+ val label2 = Span("def")
splitPanel.add(label1)
splitPanel.add(label2)
val element = document.getElementById("test")
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/panel/StackPanelSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/panel/StackPanelSpec.kt
index f8d20984..f52b6486 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/panel/StackPanelSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/StackPanelSpec.kt
@@ -21,7 +21,7 @@
*/
package test.pl.treksoft.kvision.panel
-import pl.treksoft.kvision.html.Label
+import pl.treksoft.kvision.html.Span
import pl.treksoft.kvision.panel.Root
import pl.treksoft.kvision.panel.StackPanel
import test.pl.treksoft.kvision.DomSpec
@@ -36,8 +36,8 @@ class StackPanelSpec : DomSpec {
val root = Root("test", true)
val stackPanel = StackPanel()
root.add(stackPanel)
- val label1 = Label("abc")
- val label2 = Label("def")
+ val label1 = Span("abc")
+ val label2 = Span("def")
stackPanel.add(label1)
stackPanel.add(label2)
val element = document.getElementById("test")
@@ -51,8 +51,8 @@ class StackPanelSpec : DomSpec {
val root = Root("test", true)
val stackPanel = StackPanel(activateLast = false)
root.add(stackPanel)
- val label1 = Label("abc")
- val label2 = Label("def")
+ val label1 = Span("abc")
+ val label2 = Span("def")
stackPanel.add(label1)
stackPanel.add(label2)
val element = document.getElementById("test")
@@ -70,8 +70,8 @@ class StackPanelSpec : DomSpec {
val root = Root("test", true)
val stackPanel = StackPanel(activateLast = false)
root.add(stackPanel)
- val label1 = Label("abc")
- val label2 = Label("def")
+ val label1 = Span("abc")
+ val label2 = Span("def")
stackPanel.add(label1)
stackPanel.add(label2)
stackPanel.remove(label1)
@@ -86,8 +86,8 @@ class StackPanelSpec : DomSpec {
val root = Root("test", true)
val stackPanel = StackPanel(activateLast = false)
root.add(stackPanel)
- val label1 = Label("abc")
- val label2 = Label("def")
+ val label1 = Span("abc")
+ val label2 = Span("def")
stackPanel.add(label1)
stackPanel.add(label2)
stackPanel.removeAll()
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/panel/TabPanelSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/panel/TabPanelSpec.kt
index c6e3a942..900a7268 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/panel/TabPanelSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/TabPanelSpec.kt
@@ -21,7 +21,7 @@
*/
package test.pl.treksoft.kvision.panel
-import pl.treksoft.kvision.html.Label
+import pl.treksoft.kvision.html.Span
import pl.treksoft.kvision.panel.Root
import pl.treksoft.kvision.panel.TabPanel
import test.pl.treksoft.kvision.DomSpec
@@ -36,8 +36,8 @@ class TabPanelSpec : DomSpec {
val root = Root("test", true)
val tabs = TabPanel()
root.add(tabs)
- val label1 = Label("abc")
- val label2 = Label("def")
+ val label1 = Span("abc")
+ val label2 = Span("def")
tabs.addTab("ABC", label1)
tabs.addTab("DEF", label2)
val element = document.getElementById("test")
@@ -55,8 +55,8 @@ class TabPanelSpec : DomSpec {
val root = Root("test", true)
val tabs = TabPanel()
root.add(tabs)
- val label1 = Label("abc")
- val label2 = Label("def")
+ val label1 = Span("abc")
+ val label2 = Span("def")
tabs.addTab("ABC", label1)
tabs.addTab("DEF", label2)
tabs.activeIndex = 1
@@ -75,8 +75,8 @@ class TabPanelSpec : DomSpec {
val root = Root("test", true)
val tabs = TabPanel()
root.add(tabs)
- val label1 = Label("abc")
- val label2 = Label("def")
+ val label1 = Span("abc")
+ val label2 = Span("def")
tabs.addTab("ABC", label1)
tabs.addTab("DEF", label2)
tabs.activeIndex = 1
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt
index 61a89fea..81ea720d 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt
@@ -21,7 +21,7 @@
*/
package test.pl.treksoft.kvision.panel
-import pl.treksoft.kvision.html.Label
+import pl.treksoft.kvision.html.Span
import pl.treksoft.kvision.panel.FlexJustify
import pl.treksoft.kvision.panel.Root
import pl.treksoft.kvision.panel.VPanel
@@ -37,9 +37,9 @@ class VPanelSpec : DomSpec {
val root = Root("test", true)
val vPanel = VPanel(justify = FlexJustify.SPACEBETWEEN)
root.add(vPanel)
- vPanel.add(Label("abc"), 1)
- vPanel.add(Label("def"), 2)
- vPanel.add(Label("ghi"), 3)
+ vPanel.add(Span("abc"), 1)
+ vPanel.add(Span("def"), 2)
+ vPanel.add(Span("ghi"), 3)
val element = document.getElementById("test")
assertEqualsHtml(
"<div style=\"display: flex; flex-direction: column; justify-content: space-between;\"><div style=\"order: 1;\"><span>abc</span></div><div style=\"order: 2;\"><span>def</span></div><div style=\"order: 3;\"><span>ghi</span></div></div>",