From 25ab470ea458b2652ff77e2a66a856c63553c486 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Thu, 9 Nov 2017 12:21:43 +0100 Subject: Refactoring packages --- .../test/pl/treksoft/kvision/form/CheckBoxSpec.kt | 35 ------------------ .../pl/treksoft/kvision/form/CheckInputSpec.kt | 43 ---------------------- .../test/pl/treksoft/kvision/form/PasswordSpec.kt | 29 --------------- .../test/pl/treksoft/kvision/form/RadioSpec.kt | 34 ----------------- .../pl/treksoft/kvision/form/TextAreaInputSpec.kt | 29 --------------- .../test/pl/treksoft/kvision/form/TextAreaSpec.kt | 29 --------------- .../test/pl/treksoft/kvision/form/TextInputSpec.kt | 30 --------------- .../test/pl/treksoft/kvision/form/TextSpec.kt | 29 --------------- .../pl/treksoft/kvision/form/check/CheckBoxSpec.kt | 35 ++++++++++++++++++ .../treksoft/kvision/form/check/CheckInputSpec.kt | 43 ++++++++++++++++++++++ .../pl/treksoft/kvision/form/check/RadioSpec.kt | 34 +++++++++++++++++ .../pl/treksoft/kvision/form/text/PasswordSpec.kt | 29 +++++++++++++++ .../kvision/form/text/TextAreaInputSpec.kt | 29 +++++++++++++++ .../pl/treksoft/kvision/form/text/TextAreaSpec.kt | 29 +++++++++++++++ .../pl/treksoft/kvision/form/text/TextInputSpec.kt | 30 +++++++++++++++ .../test/pl/treksoft/kvision/form/text/TextSpec.kt | 29 +++++++++++++++ 16 files changed, 258 insertions(+), 258 deletions(-) delete mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/CheckBoxSpec.kt delete mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/CheckInputSpec.kt delete mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/PasswordSpec.kt delete mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/RadioSpec.kt delete mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/TextAreaInputSpec.kt delete mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/TextAreaSpec.kt delete mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/TextInputSpec.kt delete mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/TextSpec.kt create mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckBoxSpec.kt create mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckInputSpec.kt create mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioSpec.kt create mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/text/PasswordSpec.kt create mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/text/TextAreaInputSpec.kt create mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/text/TextAreaSpec.kt create mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/text/TextInputSpec.kt create mode 100644 src/test/kotlin/test/pl/treksoft/kvision/form/text/TextSpec.kt (limited to 'src/test/kotlin') diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/CheckBoxSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/CheckBoxSpec.kt deleted file mode 100644 index dd46d747..00000000 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/CheckBoxSpec.kt +++ /dev/null @@ -1,35 +0,0 @@ -package test.pl.treksoft.kvision.form - -import pl.treksoft.kvision.core.Root -import pl.treksoft.kvision.form.CHECKBOXSTYLE -import pl.treksoft.kvision.form.CheckBox -import test.pl.treksoft.kvision.DomSpec -import kotlin.browser.document -import kotlin.test.Test -import kotlin.test.assertEquals - -class CheckBoxSpec : DomSpec { - - @Test - fun render() { - run { - val root = Root("test") - val ci = CheckBox(value = true, label = "Label").apply { - name = "name" - style = CHECKBOXSTYLE.DANGER - disabled = true - circled = true - inline = true - } - root.add(ci) - val element = document.getElementById("test") - val id = ci.input.id - assertEquals("
", element?.innerHTML, "Should render correct checkbox form field") - ci.style = CHECKBOXSTYLE.INFO - ci.circled = false - ci.inline = false - assertEquals("
", element?.innerHTML, "Should render correct checkbox form field") - } - } - -} \ No newline at end of file diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/CheckInputSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/CheckInputSpec.kt deleted file mode 100644 index fb1b0fbf..00000000 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/CheckInputSpec.kt +++ /dev/null @@ -1,43 +0,0 @@ -package test.pl.treksoft.kvision.form - -import pl.treksoft.kvision.core.Root -import pl.treksoft.kvision.form.CHECKINPUTTYPE -import pl.treksoft.kvision.form.CheckInput -import test.pl.treksoft.kvision.DomSpec -import kotlin.browser.document -import kotlin.test.Test -import kotlin.test.assertEquals - -class CheckInputSpec : DomSpec { - - @Test - fun render() { - run { - val root = Root("test") - val ci = CheckInput(value = true).apply { - name = "name" - id = "idti" - disabled = true - } - root.add(ci) - val element = document.getElementById("test") - assertEquals("", element?.innerHTML, "Should render correct checkbox field") - } - } - - @Test - fun renderAsRadio() { - run { - val root = Root("test") - val ci = CheckInput(type = CHECKINPUTTYPE.RADIO, value = true).apply { - name = "name" - id = "idti" - extraValue = "abc" - } - root.add(ci) - val element = document.getElementById("test") - assertEquals("", element?.innerHTML, "Should render correct radio button field") - } - } - -} \ No newline at end of file diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/PasswordSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/PasswordSpec.kt deleted file mode 100644 index 789d13fa..00000000 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/PasswordSpec.kt +++ /dev/null @@ -1,29 +0,0 @@ -package test.pl.treksoft.kvision.form - -import pl.treksoft.kvision.core.Root -import pl.treksoft.kvision.form.Password -import test.pl.treksoft.kvision.DomSpec -import kotlin.browser.document -import kotlin.test.Test -import kotlin.test.assertEquals - -class PasswordSpec : DomSpec { - - @Test - fun render() { - run { - val root = Root("test") - val ti = Password(value = "abc", label = "Label").apply { - placeholder = "place" - name = "name" - maxlength = 15 - disabled = true - } - root.add(ti) - val element = document.getElementById("test") - val id = ti.input.id - assertEquals("
", element?.innerHTML, "Should render correct input form field") - } - } - -} \ No newline at end of file diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/RadioSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/RadioSpec.kt deleted file mode 100644 index a0e4b853..00000000 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/RadioSpec.kt +++ /dev/null @@ -1,34 +0,0 @@ -package test.pl.treksoft.kvision.form - -import pl.treksoft.kvision.core.Root -import pl.treksoft.kvision.form.RADIOSTYLE -import pl.treksoft.kvision.form.Radio -import test.pl.treksoft.kvision.DomSpec -import kotlin.browser.document -import kotlin.test.Test -import kotlin.test.assertEquals - -class RadioSpec : DomSpec { - - @Test - fun render() { - run { - val root = Root("test") - val ci = Radio(value = true, label = "Label", extraValue = "abc").apply { - name = "name" - style = RADIOSTYLE.DANGER - disabled = true - inline = true - } - root.add(ci) - val element = document.getElementById("test") - val id = ci.input.id - assertEquals("
", element?.innerHTML, "Should render correct radio button form field") - ci.style = RADIOSTYLE.INFO - ci.squared = true - ci.inline = false - assertEquals("
", element?.innerHTML, "Should render correct radio button form field") - } - } - -} \ No newline at end of file diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/TextAreaInputSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/TextAreaInputSpec.kt deleted file mode 100644 index ff73b35c..00000000 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/TextAreaInputSpec.kt +++ /dev/null @@ -1,29 +0,0 @@ -package test.pl.treksoft.kvision.form - -import pl.treksoft.kvision.core.Root -import pl.treksoft.kvision.form.TextAreaInput -import test.pl.treksoft.kvision.DomSpec -import kotlin.browser.document -import kotlin.test.Test -import kotlin.test.assertEquals - -class TextAreaInputSpec : DomSpec { - - @Test - fun render() { - run { - val root = Root("test") - val ti = TextAreaInput(cols = 5, rows = 2, value = "abc").apply { - placeholder = "place" - name = "name" - maxlength = 15 - id = "idti" - disabled = true - } - root.add(ti) - val element = document.getElementById("test") - assertEquals("", element?.innerHTML, "Should render correct input field") - } - } - -} \ No newline at end of file diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/TextAreaSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/TextAreaSpec.kt deleted file mode 100644 index 3be42379..00000000 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/TextAreaSpec.kt +++ /dev/null @@ -1,29 +0,0 @@ -package test.pl.treksoft.kvision.form - -import pl.treksoft.kvision.core.Root -import pl.treksoft.kvision.form.TextArea -import test.pl.treksoft.kvision.DomSpec -import kotlin.browser.document -import kotlin.test.Test -import kotlin.test.assertEquals - -class TextAreaSpec : DomSpec { - - @Test - fun render() { - run { - val root = Root("test") - val ti = TextArea(cols = 5, rows = 2, value = "abc", label = "Label").apply { - placeholder = "place" - name = "name" - maxlength = 15 - disabled = true - } - root.add(ti) - val element = document.getElementById("test") - val id = ti.input.id - assertEquals("
", element?.innerHTML, "Should render correct input form field") - } - } - -} \ No newline at end of file diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/TextInputSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/TextInputSpec.kt deleted file mode 100644 index 0bce8656..00000000 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/TextInputSpec.kt +++ /dev/null @@ -1,30 +0,0 @@ -package test.pl.treksoft.kvision.form - -import pl.treksoft.kvision.core.Root -import pl.treksoft.kvision.form.TEXTINPUTTYPE -import pl.treksoft.kvision.form.TextInput -import test.pl.treksoft.kvision.DomSpec -import kotlin.browser.document -import kotlin.test.Test -import kotlin.test.assertEquals - -class TextInputSpec : DomSpec { - - @Test - fun render() { - run { - val root = Root("test") - val ti = TextInput(type = TEXTINPUTTYPE.PASSWORD, value = "abc").apply { - placeholder = "place" - name = "name" - maxlength = 15 - id = "idti" - disabled = true - } - root.add(ti) - val element = document.getElementById("test") - assertEquals("", element?.innerHTML, "Should render correct input field") - } - } - -} \ No newline at end of file diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/TextSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/TextSpec.kt deleted file mode 100644 index 8b460e3c..00000000 --- a/src/test/kotlin/test/pl/treksoft/kvision/form/TextSpec.kt +++ /dev/null @@ -1,29 +0,0 @@ -package test.pl.treksoft.kvision.form - -import pl.treksoft.kvision.core.Root -import pl.treksoft.kvision.form.Text -import test.pl.treksoft.kvision.DomSpec -import kotlin.browser.document -import kotlin.test.Test -import kotlin.test.assertEquals - -class TextSpec : DomSpec { - - @Test - fun render() { - run { - val root = Root("test") - val ti = Text(value = "abc", label = "Label").apply { - placeholder = "place" - name = "name" - maxlength = 15 - disabled = true - } - root.add(ti) - val element = document.getElementById("test") - val id = ti.input.id - assertEquals("
", element?.innerHTML, "Should render correct input form field") - } - } - -} \ No newline at end of file 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 new file mode 100644 index 00000000..9bf3e82b --- /dev/null +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckBoxSpec.kt @@ -0,0 +1,35 @@ +package test.pl.treksoft.kvision.form.check + +import pl.treksoft.kvision.core.Root +import pl.treksoft.kvision.form.check.CHECKBOXSTYLE +import pl.treksoft.kvision.form.check.CheckBox +import test.pl.treksoft.kvision.DomSpec +import kotlin.browser.document +import kotlin.test.Test +import kotlin.test.assertEquals + +class CheckBoxSpec : DomSpec { + + @Test + fun render() { + run { + val root = Root("test") + val ci = CheckBox(value = true, label = "Label").apply { + name = "name" + style = CHECKBOXSTYLE.DANGER + disabled = true + circled = true + inline = true + } + root.add(ci) + val element = document.getElementById("test") + val id = ci.input.id + assertEquals("
", element?.innerHTML, "Should render correct checkbox form field") + ci.style = CHECKBOXSTYLE.INFO + ci.circled = false + ci.inline = false + assertEquals("
", element?.innerHTML, "Should render correct checkbox form field") + } + } + +} \ No newline at end of file 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 new file mode 100644 index 00000000..daac7bb9 --- /dev/null +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckInputSpec.kt @@ -0,0 +1,43 @@ +package test.pl.treksoft.kvision.form.check + +import pl.treksoft.kvision.core.Root +import pl.treksoft.kvision.form.check.CHECKINPUTTYPE +import pl.treksoft.kvision.form.check.CheckInput +import test.pl.treksoft.kvision.DomSpec +import kotlin.browser.document +import kotlin.test.Test +import kotlin.test.assertEquals + +class CheckInputSpec : DomSpec { + + @Test + fun render() { + run { + val root = Root("test") + val ci = CheckInput(value = true).apply { + name = "name" + id = "idti" + disabled = true + } + root.add(ci) + val element = document.getElementById("test") + assertEquals("", element?.innerHTML, "Should render correct checkbox field") + } + } + + @Test + fun renderAsRadio() { + run { + val root = Root("test") + val ci = CheckInput(type = CHECKINPUTTYPE.RADIO, value = true).apply { + name = "name" + id = "idti" + extraValue = "abc" + } + root.add(ci) + val element = document.getElementById("test") + assertEquals("", element?.innerHTML, "Should render correct radio button field") + } + } + +} \ No newline at end of file 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 new file mode 100644 index 00000000..aff444bf --- /dev/null +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioSpec.kt @@ -0,0 +1,34 @@ +package test.pl.treksoft.kvision.form.check + +import pl.treksoft.kvision.core.Root +import pl.treksoft.kvision.form.check.RADIOSTYLE +import pl.treksoft.kvision.form.check.Radio +import test.pl.treksoft.kvision.DomSpec +import kotlin.browser.document +import kotlin.test.Test +import kotlin.test.assertEquals + +class RadioSpec : DomSpec { + + @Test + fun render() { + run { + val root = Root("test") + val ci = Radio(value = true, label = "Label", extraValue = "abc").apply { + name = "name" + style = RADIOSTYLE.DANGER + disabled = true + inline = true + } + root.add(ci) + val element = document.getElementById("test") + val id = ci.input.id + assertEquals("
", element?.innerHTML, "Should render correct radio button form field") + ci.style = RADIOSTYLE.INFO + ci.squared = true + ci.inline = false + assertEquals("
", element?.innerHTML, "Should render correct radio button form field") + } + } + +} \ No newline at end of file diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/text/PasswordSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/text/PasswordSpec.kt new file mode 100644 index 00000000..9533c917 --- /dev/null +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/text/PasswordSpec.kt @@ -0,0 +1,29 @@ +package test.pl.treksoft.kvision.form.text + +import pl.treksoft.kvision.core.Root +import pl.treksoft.kvision.form.text.Password +import test.pl.treksoft.kvision.DomSpec +import kotlin.browser.document +import kotlin.test.Test +import kotlin.test.assertEquals + +class PasswordSpec : DomSpec { + + @Test + fun render() { + run { + val root = Root("test") + val ti = Password(value = "abc", label = "Label").apply { + placeholder = "place" + name = "name" + maxlength = 15 + disabled = true + } + root.add(ti) + val element = document.getElementById("test") + val id = ti.input.id + assertEquals("
", element?.innerHTML, "Should render correct input form field") + } + } + +} \ No newline at end of file diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextAreaInputSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextAreaInputSpec.kt new file mode 100644 index 00000000..560e48dd --- /dev/null +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextAreaInputSpec.kt @@ -0,0 +1,29 @@ +package test.pl.treksoft.kvision.form.text + +import pl.treksoft.kvision.core.Root +import pl.treksoft.kvision.form.text.TextAreaInput +import test.pl.treksoft.kvision.DomSpec +import kotlin.browser.document +import kotlin.test.Test +import kotlin.test.assertEquals + +class TextAreaInputSpec : DomSpec { + + @Test + fun render() { + run { + val root = Root("test") + val ti = TextAreaInput(cols = 5, rows = 2, value = "abc").apply { + placeholder = "place" + name = "name" + maxlength = 15 + id = "idti" + disabled = true + } + root.add(ti) + val element = document.getElementById("test") + assertEquals("", element?.innerHTML, "Should render correct input field") + } + } + +} \ No newline at end of file diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextAreaSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextAreaSpec.kt new file mode 100644 index 00000000..018713ba --- /dev/null +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextAreaSpec.kt @@ -0,0 +1,29 @@ +package test.pl.treksoft.kvision.form.text + +import pl.treksoft.kvision.core.Root +import pl.treksoft.kvision.form.text.TextArea +import test.pl.treksoft.kvision.DomSpec +import kotlin.browser.document +import kotlin.test.Test +import kotlin.test.assertEquals + +class TextAreaSpec : DomSpec { + + @Test + fun render() { + run { + val root = Root("test") + val ti = TextArea(cols = 5, rows = 2, value = "abc", label = "Label").apply { + placeholder = "place" + name = "name" + maxlength = 15 + disabled = true + } + root.add(ti) + val element = document.getElementById("test") + val id = ti.input.id + assertEquals("
", element?.innerHTML, "Should render correct input form field") + } + } + +} \ No newline at end of file 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 new file mode 100644 index 00000000..9ae0db43 --- /dev/null +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextInputSpec.kt @@ -0,0 +1,30 @@ +package test.pl.treksoft.kvision.form.text + +import pl.treksoft.kvision.core.Root +import pl.treksoft.kvision.form.text.TEXTINPUTTYPE +import pl.treksoft.kvision.form.text.TextInput +import test.pl.treksoft.kvision.DomSpec +import kotlin.browser.document +import kotlin.test.Test +import kotlin.test.assertEquals + +class TextInputSpec : DomSpec { + + @Test + fun render() { + run { + val root = Root("test") + val ti = TextInput(type = TEXTINPUTTYPE.PASSWORD, value = "abc").apply { + placeholder = "place" + name = "name" + maxlength = 15 + id = "idti" + disabled = true + } + root.add(ti) + val element = document.getElementById("test") + assertEquals("", element?.innerHTML, "Should render correct input field") + } + } + +} \ No newline at end of file diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextSpec.kt new file mode 100644 index 00000000..74b89cba --- /dev/null +++ b/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextSpec.kt @@ -0,0 +1,29 @@ +package test.pl.treksoft.kvision.form.text + +import pl.treksoft.kvision.core.Root +import pl.treksoft.kvision.form.text.Text +import test.pl.treksoft.kvision.DomSpec +import kotlin.browser.document +import kotlin.test.Test +import kotlin.test.assertEquals + +class TextSpec : DomSpec { + + @Test + fun render() { + run { + val root = Root("test") + val ti = Text(value = "abc", label = "Label").apply { + placeholder = "place" + name = "name" + maxlength = 15 + disabled = true + } + root.add(ti) + val element = document.getElementById("test") + val id = ti.input.id + assertEquals("
", element?.innerHTML, "Should render correct input form field") + } + } + +} \ No newline at end of file -- cgit