diff options
Diffstat (limited to 'src/test/kotlin')
16 files changed, 44 insertions, 44 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/core/WidgetWrapperSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/core/WidgetWrapperSpec.kt index ff224b99..a3f17b3d 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/core/WidgetWrapperSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/core/WidgetWrapperSpec.kt @@ -22,7 +22,7 @@ package test.pl.treksoft.kvision.core import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.core.UNIT +import pl.treksoft.kvision.core.Unit import pl.treksoft.kvision.core.Widget import pl.treksoft.kvision.core.WidgetWrapper import test.pl.treksoft.kvision.DomSpec @@ -38,7 +38,7 @@ class WidgetWrapperSpec : DomSpec { val root = Root("test") val widget = Widget() val wrapper = WidgetWrapper(widget) - wrapper.width = 100 to UNIT.em + wrapper.width = 100 to Unit.em root.add(wrapper) val element = document.getElementById("test") assertEquals( diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckBoxSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckBoxSpec.kt index 3aa427ed..752bb378 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckBoxSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckBoxSpec.kt @@ -22,7 +22,7 @@ package test.pl.treksoft.kvision.form.check import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.form.check.CHECKBOXSTYLE +import pl.treksoft.kvision.form.check.CheckBoxStyle import pl.treksoft.kvision.form.check.CheckBox import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document @@ -37,7 +37,7 @@ class CheckBoxSpec : DomSpec { val root = Root("test") val ci = CheckBox(value = true, label = "Label").apply { name = "name" - style = CHECKBOXSTYLE.DANGER + style = CheckBoxStyle.DANGER disabled = true circled = true inline = true @@ -50,7 +50,7 @@ class CheckBoxSpec : DomSpec { element?.innerHTML, "Should render correct checkbox form control" ) - ci.style = CHECKBOXSTYLE.INFO + ci.style = CheckBoxStyle.INFO ci.circled = false ci.inline = false assertEquals( diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckInputSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckInputSpec.kt index 960dad56..eeea3052 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckInputSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckInputSpec.kt @@ -22,7 +22,7 @@ package test.pl.treksoft.kvision.form.check import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.form.check.CHECKINPUTTYPE +import pl.treksoft.kvision.form.check.CheckInputType import pl.treksoft.kvision.form.check.CheckInput import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document @@ -54,7 +54,7 @@ class CheckInputSpec : DomSpec { fun renderAsRadio() { run { val root = Root("test") - val ci = CheckInput(type = CHECKINPUTTYPE.RADIO, value = true).apply { + val ci = CheckInput(type = CheckInputType.RADIO, value = true).apply { name = "name" id = "idti" extraValue = "abc" diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioSpec.kt index f7020d09..d0e72dea 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioSpec.kt @@ -22,7 +22,7 @@ package test.pl.treksoft.kvision.form.check import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.form.check.RADIOSTYLE +import pl.treksoft.kvision.form.check.RadioStyle import pl.treksoft.kvision.form.check.Radio import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document @@ -37,7 +37,7 @@ class RadioSpec : DomSpec { val root = Root("test") val ci = Radio(value = true, label = "Label", extraValue = "abc").apply { name = "name" - style = RADIOSTYLE.DANGER + style = RadioStyle.DANGER disabled = true inline = true } @@ -49,7 +49,7 @@ class RadioSpec : DomSpec { element?.innerHTML, "Should render correct radio button form control" ) - ci.style = RADIOSTYLE.INFO + ci.style = RadioStyle.INFO ci.squared = true ci.inline = false assertEquals( diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectInputSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectInputSpec.kt index c51a6b43..740c4032 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectInputSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectInputSpec.kt @@ -22,7 +22,7 @@ package test.pl.treksoft.kvision.form.select import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.form.select.SELECTWIDTHTYPE +import pl.treksoft.kvision.form.select.SelectWidthType import pl.treksoft.kvision.form.select.SelectInput import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document @@ -38,7 +38,7 @@ class SelectInputSpec : DomSpec { val selectInput = SelectInput(listOf("test1" to "Test 1", "test2" to "Test 2"), "test1", true).apply { liveSearch = true placeholder = "Choose ..." - selectWidthType = SELECTWIDTHTYPE.FIT + selectWidthType = SelectWidthType.FIT emptyOption = true } root.add(selectInput) diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectSpec.kt index ae07199c..15a01542 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/select/SelectSpec.kt @@ -22,7 +22,7 @@ package test.pl.treksoft.kvision.form.select import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.form.select.SELECTWIDTHTYPE +import pl.treksoft.kvision.form.select.SelectWidthType import pl.treksoft.kvision.form.select.Select import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document @@ -38,7 +38,7 @@ class SelectSpec : DomSpec { val select = Select(listOf("test1" to "Test 1", "test2" to "Test 2"), "test1", true, null, "Label").apply { liveSearch = true placeholder = "Choose ..." - selectWidthType = SELECTWIDTHTYPE.FIT + selectWidthType = SelectWidthType.FIT emptyOption = true } root.add(select) diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextInputSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextInputSpec.kt index de3bd486..8b743a6a 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextInputSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextInputSpec.kt @@ -22,7 +22,7 @@ package test.pl.treksoft.kvision.form.text import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.form.text.TEXTINPUTTYPE +import pl.treksoft.kvision.form.text.TextInputType import pl.treksoft.kvision.form.text.TextInput import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document @@ -35,7 +35,7 @@ class TextInputSpec : DomSpec { fun render() { run { val root = Root("test") - val ti = TextInput(type = TEXTINPUTTYPE.PASSWORD, value = "abc").apply { + val ti = TextInput(type = TextInputType.PASSWORD, value = "abc").apply { placeholder = "place" name = "name" maxlength = 15 diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/ButtonSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/ButtonSpec.kt index 22ac0c02..d70d28e2 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/html/ButtonSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/html/ButtonSpec.kt @@ -22,8 +22,8 @@ package test.pl.treksoft.kvision.html import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.html.BUTTONSIZE -import pl.treksoft.kvision.html.BUTTONSTYLE +import pl.treksoft.kvision.html.ButtonSize +import pl.treksoft.kvision.html.ButtonStyle import pl.treksoft.kvision.html.Button import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document @@ -36,8 +36,8 @@ class ButtonSpec : DomSpec { fun render() { run { val root = Root("test") - val button = Button("Cancel", "fa-bars", BUTTONSTYLE.PRIMARY) - button.size = BUTTONSIZE.LARGE + val button = Button("Cancel", "fa-bars", ButtonStyle.PRIMARY) + button.size = ButtonSize.LARGE button.block = true root.add(button) val element = document.getElementById("test") diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt index 45ea9eb0..ebc6546d 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt @@ -22,7 +22,7 @@ package test.pl.treksoft.kvision.html import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.html.IMAGESHAPE +import pl.treksoft.kvision.html.ImageShape import pl.treksoft.kvision.html.Image import test.pl.treksoft.kvision.DomSpec import test.pl.treksoft.kvision.require @@ -38,7 +38,7 @@ class ImageSpec : DomSpec { val root = Root("test") val res = require("./img/placeholder.png") @Suppress("UnsafeCastFromDynamic") - val image = Image(res, "Image", true, IMAGESHAPE.ROUNDED, true) + val image = Image(res, "Image", true, ImageShape.ROUNDED, true) root.add(image) val element = document.getElementById("test") assertEquals( diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/ListSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/ListSpec.kt index 15d25309..8a8def6d 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/html/ListSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/html/ListSpec.kt @@ -22,7 +22,7 @@ package test.pl.treksoft.kvision.html import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.html.LISTTYPE +import pl.treksoft.kvision.html.ListType import pl.treksoft.kvision.html.ListTag import pl.treksoft.kvision.html.TAG import pl.treksoft.kvision.html.Tag @@ -37,7 +37,7 @@ class ListSpec : DomSpec { fun renderElements() { run { val root = Root("test") - val list = ListTag(LISTTYPE.DL_HORIZ, listOf("a1", "a2", "b1", "b2")) + val list = ListTag(ListType.DL_HORIZ, listOf("a1", "a2", "b1", "b2")) root.add(list) val element = document.getElementById("test") assertEquals( @@ -52,7 +52,7 @@ class ListSpec : DomSpec { fun renderAsContainer() { run { val root = Root("test") - val list = ListTag(LISTTYPE.UL) + val list = ListTag(ListType.UL) list.add(Tag(TAG.PRE, "pre")) list.add(Tag(TAG.DEL, "del")) root.add(list) diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/TagSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/TagSpec.kt index 98ffa57a..3bccaa20 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/html/TagSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/html/TagSpec.kt @@ -22,7 +22,7 @@ package test.pl.treksoft.kvision.html import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.html.ALIGN +import pl.treksoft.kvision.html.Align import pl.treksoft.kvision.html.Link import pl.treksoft.kvision.html.TAG import pl.treksoft.kvision.html.Tag @@ -37,7 +37,7 @@ class TagSpec : DomSpec { fun render() { run { val root = Root("test") - val tag = Tag(TAG.H1, "This is <b>h1</b>", rich = false, align = ALIGN.CENTER) + val tag = Tag(TAG.H1, "This is <b>h1</b>", rich = false, align = Align.CENTER) root.add(tag) val element = document.getElementById("test") assertEquals( @@ -52,7 +52,7 @@ class TagSpec : DomSpec { fun renderRich() { run { val root = Root("test") - val tag = Tag(TAG.H1, "This is <b>h1</b>", rich = true, align = ALIGN.RIGHT) + val tag = Tag(TAG.H1, "This is <b>h1</b>", rich = true, align = Align.RIGHT) root.add(tag) val element = document.getElementById("test") assertEquals( @@ -67,7 +67,7 @@ class TagSpec : DomSpec { fun renderAsContainer() { run { val root = Root("test") - val tag = Tag(TAG.P, align = ALIGN.RIGHT) + val tag = Tag(TAG.P, align = Align.RIGHT) tag.add(Tag(TAG.DEL, "This is test")) tag.add(Link("abc", "/x")) root.add(tag) 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 e60203cd..9dd21892 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/panel/DockPanelSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/DockPanelSpec.kt @@ -24,7 +24,7 @@ package test.pl.treksoft.kvision.panel import pl.treksoft.kvision.html.Label import pl.treksoft.kvision.panel.Root import pl.treksoft.kvision.panel.DockPanel -import pl.treksoft.kvision.panel.SIDE +import pl.treksoft.kvision.panel.Side import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document import kotlin.test.Test @@ -38,11 +38,11 @@ class DockPanelSpec : DomSpec { val root = Root("test") 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(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) val element = document.getElementById("test") assertEquals( "<div><div style=\"display: flex; flex-direction: column; justify-content: space-between; align-items: stretch;\"><div style=\"order: 2;\"><div style=\"display: flex; justify-content: space-between; align-items: center;\"><div style=\"order: 3;\"><span>def</span></div><div style=\"order: 1;\"><span>jkl</span></div><div style=\"order: 2;\"><span>mno</span></div></div></div><div style=\"order: 1; align-self: center;\"><span>abc</span></div><div style=\"order: 3; align-self: center;\"><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 d259786a..9fd0f5e9 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/panel/FlexPanelSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/FlexPanelSpec.kt @@ -23,8 +23,8 @@ package test.pl.treksoft.kvision.panel import pl.treksoft.kvision.html.Label import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.panel.FLEXDIR -import pl.treksoft.kvision.panel.FLEXJUSTIFY +import pl.treksoft.kvision.panel.FlexDir +import pl.treksoft.kvision.panel.FlexJustify import pl.treksoft.kvision.panel.FlexPanel import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document @@ -37,7 +37,7 @@ class FlexPanelSpec : DomSpec { fun render() { run { val root = Root("test") - val flexPanel = FlexPanel(FLEXDIR.ROWREV, justify = FLEXJUSTIFY.SPACEEVENLY) + val flexPanel = FlexPanel(FlexDir.ROWREV, justify = FlexJustify.SPACEEVENLY) root.add(flexPanel) flexPanel.add(Label("abc"), 1) flexPanel.add(Label("def"), 2) 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 5072aff2..4ae3f1d5 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/panel/HPanelSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/HPanelSpec.kt @@ -23,7 +23,7 @@ package test.pl.treksoft.kvision.panel import pl.treksoft.kvision.html.Label import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.panel.FLEXJUSTIFY +import pl.treksoft.kvision.panel.FlexJustify import pl.treksoft.kvision.panel.HPanel import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document @@ -36,7 +36,7 @@ class HPanelSpec : DomSpec { fun render() { run { val root = Root("test") - val hPanel = HPanel(justify = FLEXJUSTIFY.SPACEBETWEEN) + val hPanel = HPanel(justify = FlexJustify.SPACEBETWEEN) root.add(hPanel) hPanel.add(Label("abc"), 1) hPanel.add(Label("def"), 2) 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 09284c5d..d270ea2b 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/panel/SplitPanelSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/SplitPanelSpec.kt @@ -23,7 +23,7 @@ package test.pl.treksoft.kvision.panel import pl.treksoft.kvision.html.Label import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.panel.DIRECTION +import pl.treksoft.kvision.panel.Direction import pl.treksoft.kvision.panel.SplitPanel import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document @@ -36,7 +36,7 @@ class SplitPanelSpec : DomSpec { fun render() { run { val root = Root("test") - val splitPanel = SplitPanel(DIRECTION.VERTICAL) + val splitPanel = SplitPanel(Direction.VERTICAL) root.add(splitPanel) val label1 = Label("abc") val label2 = Label("def") 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 ac985cd0..9278d46c 100644 --- a/src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt +++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt @@ -23,7 +23,7 @@ package test.pl.treksoft.kvision.panel import pl.treksoft.kvision.html.Label import pl.treksoft.kvision.panel.Root -import pl.treksoft.kvision.panel.FLEXJUSTIFY +import pl.treksoft.kvision.panel.FlexJustify import pl.treksoft.kvision.panel.VPanel import test.pl.treksoft.kvision.DomSpec import kotlin.browser.document @@ -36,7 +36,7 @@ class VPanelSpec : DomSpec { fun render() { run { val root = Root("test") - val vPanel = VPanel(justify = FLEXJUSTIFY.SPACEBETWEEN) + val vPanel = VPanel(justify = FlexJustify.SPACEBETWEEN) root.add(vPanel) vPanel.add(Label("abc"), 1) vPanel.add(Label("def"), 2) |