aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-10-06 20:38:07 +0200
committerRobert Jaros <rjaros@finn.pl>2019-10-06 20:38:07 +0200
commit6b14906f0e35dc522bd1c1a44682d728315cf619 (patch)
tree4f96d1c3bb8281289b96e2b11eecc404a3c98788 /src/test
parent6ddb5374d4f1f629c98392e104460351065eaa7c (diff)
downloadkvision-6b14906f0e35dc522bd1c1a44682d728315cf619.tar.gz
kvision-6b14906f0e35dc522bd1c1a44682d728315cf619.tar.bz2
kvision-6b14906f0e35dc522bd1c1a44682d728315cf619.zip
Update all tests.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/form/HelpTextSpec.kt4
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/form/check/CheckBoxSpec.kt4
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioGroupInputSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioGroupSpec.kt6
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioSpec.kt4
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/form/text/TextSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/ButtonSpec.kt4
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/IconSpec.kt4
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/table/TableSpec.kt4
10 files changed, 18 insertions, 18 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/HelpTextSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/HelpTextSpec.kt
index 4be84d22..785f9a2c 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/form/HelpTextSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/form/HelpTextSpec.kt
@@ -27,7 +27,7 @@ import test.pl.treksoft.kvision.DomSpec
import kotlin.browser.document
import kotlin.test.Test
-class HelpBlockSpec : DomSpec {
+class HelpTextSpec : DomSpec {
@Test
fun render() {
@@ -37,7 +37,7 @@ class HelpBlockSpec : DomSpec {
root.add(fl)
val element = document.getElementById("test")
assertEqualsHtml(
- "<span class=\"help-block small\">Form Error</span>",
+ "<small class=\"form-text text-muted\">Form Error</small>",
element?.innerHTML,
"Should render correct help block"
)
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 16da0c70..2c329ffa 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
@@ -45,7 +45,7 @@ class CheckBoxSpec : DomSpec {
val element = document.getElementById("test")
val id = ci.input.id
assertEqualsHtml(
- "<div class=\"checkbox checkbox-danger checkbox-circle checkbox-inline\"><input class=\"styled\" id=\"$id\" type=\"checkbox\" checked=\"checked\" name=\"name\" disabled=\"disabled\"><label for=\"$id\">Label</label></div>",
+ "<div class=\"form-check abc-checkbox abc-checkbox-danger abc-checkbox-circle form-check-inline\"><input class=\"form-check-input\" id=\"$id\" type=\"checkbox\" checked=\"checked\" name=\"name\" disabled=\"disabled\"><label class=\"form-check-label\" for=\"$id\">Label</label></div>",
element?.innerHTML,
"Should render correct checkbox form control"
)
@@ -53,7 +53,7 @@ class CheckBoxSpec : DomSpec {
ci.circled = false
ci.inline = false
assertEqualsHtml(
- "<div class=\"checkbox checkbox-info\"><input class=\"styled\" id=\"$id\" type=\"checkbox\" checked=\"checked\" name=\"name\" disabled=\"disabled\"><label for=\"$id\">Label</label></div>",
+ "<div class=\"form-check abc-checkbox abc-checkbox-info\"><input class=\"form-check-input\" id=\"$id\" type=\"checkbox\" checked=\"checked\" name=\"name\" disabled=\"disabled\"><label class=\"form-check-label\" for=\"$id\">Label</label></div>",
element?.innerHTML,
"Should render correct checkbox form control"
)
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioGroupInputSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioGroupInputSpec.kt
index 55788c84..020ad529 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioGroupInputSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioGroupInputSpec.kt
@@ -44,7 +44,7 @@ class RadioGroupInputSpec : DomSpec {
val rid1 = ci.getChildren().filterIsInstance<Radio>().first().input.id
val rid2 = ci.getChildren().filterIsInstance<Radio>().last().input.id
assertEqualsHtml(
- "<div class=\"form-group kv-radiogroup-inline\"><div class=\"radio\"><input id=\"$rid1\" type=\"radio\" name=\"$name\" disabled=\"disabled\" value=\"a\"><label for=\"$rid1\">A</label></div><div class=\"radio\"><input id=\"$rid2\" type=\"radio\" name=\"$name\" disabled=\"disabled\" value=\"b\"><label for=\"$rid2\">B</label></div></div>",
+ "<div class=\"form-group kv-radiogroup-inline\"><div class=\"form-check abc-radio\"><input class=\"form-check-input\" id=\"$rid1\" type=\"radio\" name=\"$name\" disabled=\"disabled\" value=\"a\"><label class=\"form-check-label\" for=\"$rid1\">A</label></div><div class=\"form-check abc-radio\"><input class=\"form-check-input\" id=\"$rid2\" type=\"radio\" name=\"$name\" disabled=\"disabled\" value=\"b\"><label class=\"form-check-label\" for=\"$rid2\">B</label></div></div>",
element?.innerHTML,
"Should render correct radio button group form control"
)
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioGroupSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioGroupSpec.kt
index 2ed52b67..77547977 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioGroupSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/form/check/RadioGroupSpec.kt
@@ -41,10 +41,10 @@ class RadioGroupSpec : DomSpec {
root.add(ci)
val element = document.getElementById("test")
val id = ci.flabel.forId
- val rid1 = ci.getChildren().filterIsInstance<Radio>().first().input.id
- val rid2 = ci.getChildren().filterIsInstance<Radio>().last().input.id
+ val rid1 = ci.container.getChildren().filterIsInstance<Radio>().first().input.id
+ val rid2 = ci.container.getChildren().filterIsInstance<Radio>().last().input.id
assertEqualsHtml(
- "<div class=\"form-group kv-radiogroup-inline\"><label class=\"control-label\" for=\"$id\">Label</label><div class=\"radio\"><input id=\"$rid1\" type=\"radio\" name=\"$id\" disabled=\"disabled\" value=\"a\"><label for=\"$rid1\">A</label></div><div class=\"radio\"><input id=\"$rid2\" type=\"radio\" name=\"$id\" disabled=\"disabled\" value=\"b\"><label for=\"$rid2\">B</label></div></div>",
+ "<div class=\"form-group kv-radiogroup-inline\"><label class=\"control-label\" for=\"$id\">Label</label><div class=\"kv-radiogroup-container\"><div class=\"form-check abc-radio\"><input class=\"form-check-input\" id=\"$rid1\" type=\"radio\" name=\"$id\" disabled=\"disabled\" value=\"a\"><label class=\"form-check-label\" for=\"$rid1\">A</label></div><div class=\"form-check abc-radio\"><input class=\"form-check-input\" id=\"$rid2\" type=\"radio\" name=\"$id\" disabled=\"disabled\" value=\"b\"><label class=\"form-check-label\" for=\"$rid2\">B</label></div></div></div>",
element?.innerHTML,
"Should render correct radio button group form control"
)
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 bd0b3993..c709b548 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
@@ -44,7 +44,7 @@ class RadioSpec : DomSpec {
val element = document.getElementById("test")
val id = ci.input.id
assertEqualsHtml(
- "<div class=\"radio radio-danger radio-inline\"><input id=\"$id\" type=\"radio\" checked=\"checked\" name=\"name\" disabled=\"disabled\" value=\"abc\"><label for=\"$id\">Label</label></div>",
+ "<div class=\"form-check abc-radio abc-radio-danger form-check-inline\"><input class=\"form-check-input\" id=\"$id\" type=\"radio\" checked=\"checked\" name=\"name\" disabled=\"disabled\" value=\"abc\"><label class=\"form-check-label\" for=\"$id\">Label</label></div>",
element?.innerHTML,
"Should render correct radio button form control"
)
@@ -52,7 +52,7 @@ class RadioSpec : DomSpec {
ci.squared = true
ci.inline = false
assertEqualsHtml(
- "<div class=\"checkbox checkbox-info\"><input id=\"$id\" type=\"radio\" checked=\"checked\" name=\"name\" disabled=\"disabled\" value=\"abc\"><label for=\"$id\">Label</label></div>",
+ "<div class=\"form-check abc-checkbox abc-checkbox-info\"><input class=\"form-check-input\" id=\"$id\" type=\"radio\" checked=\"checked\" name=\"name\" disabled=\"disabled\" value=\"abc\"><label class=\"form-check-label\" for=\"$id\">Label</label></div>",
element?.innerHTML,
"Should render correct radio button form control"
)
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
index 2bc35a38..02ba7643 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/form/text/TextSpec.kt
@@ -49,7 +49,7 @@ class TextSpec : DomSpec {
)
ti.validatorError = "Validation Error"
assertEqualsHtml(
- "<div class=\"form-group text-danger\"><label class=\"control-label\" for=\"$id\">Label</label><input class=\"form-control\" id=\"$id\" placeholder=\"place\" name=\"name\" maxlength=\"15\" disabled=\"disabled\" type=\"text\" value=\"abc\"><span class=\"help-block small\">Validation Error</span></div>",
+ "<div class=\"form-group text-danger\"><label class=\"control-label\" for=\"$id\">Label</label><input class=\"form-control is-invalid\" id=\"$id\" placeholder=\"place\" name=\"name\" maxlength=\"15\" disabled=\"disabled\" type=\"text\" value=\"abc\"><div class=\"invalid-feedback\">Validation Error</div></div>",
element?.innerHTML,
"Should render correct input form control with validation error"
)
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 512c3bc2..e807bfd5 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/html/ButtonSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/ButtonSpec.kt
@@ -35,13 +35,13 @@ class ButtonSpec : DomSpec {
fun render() {
run {
val root = Root("test", fixed = true)
- val button = Button("Cancel", "fa-bars", ButtonStyle.PRIMARY)
+ val button = Button("Cancel", "fas fa-bars", ButtonStyle.PRIMARY)
button.size = ButtonSize.LARGE
button.block = true
root.add(button)
val element = document.getElementById("test")
assertEqualsHtml(
- "<button class=\"btn btn-primary btn-lg btn-block\" type=\"button\"><i class=\"fa fa-bars\"></i> Cancel</button>",
+ "<button class=\"btn btn-primary btn-lg btn-block\" type=\"button\"><i class=\"fas fa-bars\"></i> Cancel</button>",
element?.innerHTML,
"Should render correct html button"
)
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/IconSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/IconSpec.kt
index ea3425c5..9a63c68e 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/html/IconSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/IconSpec.kt
@@ -33,10 +33,10 @@ class IconSpec : DomSpec {
fun render() {
run {
val root = Root("test", fixed = true)
- val icon = Icon("fa-check")
+ val icon = Icon("fas fa-check")
root.add(icon)
val element = document.getElementById("test")
- assertEqualsHtml("<span class=\"fa fa-check\"></span>", element?.innerHTML, "Should render correct icon")
+ assertEqualsHtml("<span class=\"fas fa-check\"></span>", element?.innerHTML, "Should render correct icon")
}
}
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 169575fc..ed3a5347 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt
@@ -41,7 +41,7 @@ class ImageSpec : DomSpec {
root.add(image)
val element = document.getElementById("test")
assertEqualsHtml(
- "<img class=\"img-responsive center-block img-rounded\" src=\"$res\" alt=\"Image\">",
+ "<img class=\"img-fluid center-block rounded\" src=\"$res\" alt=\"Image\">",
element?.innerHTML,
"Should render correct html image"
)
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/table/TableSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/table/TableSpec.kt
index c312040a..69dc05d3 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/table/TableSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/table/TableSpec.kt
@@ -46,7 +46,7 @@ class TableSpec : DomSpec {
root.add(table)
val element = document.getElementById("test")
assertEqualsHtml(
- "<table class=\"table\"><thead><tr><th>a</th><th>b</th></tr></thead><tbody><tr><td>A</td><td>B</td></tr></tbody></table>",
+ "<table class=\"table\"><thead><tr><th scope=\"col\">a</th><th scope=\"col\">b</th></tr></thead><tbody><tr><td>A</td><td>B</td></tr></tbody></table>",
element?.innerHTML,
"Should render correct table"
)
@@ -55,7 +55,7 @@ class TableSpec : DomSpec {
table.types = setOf(TableType.BORDERED)
val element2 = document.getElementById("test")
assertEqualsHtml(
- "<div class=\"table-responsive\"><table class=\"table table-bordered\"><caption>Caption</caption><thead><tr><th>a</th><th>b</th></tr></thead><tbody><tr><td>A</td><td>B</td></tr></tbody></table></div>",
+ "<div class=\"table-responsive\"><table class=\"table table-bordered\"><caption>Caption</caption><thead><tr><th scope=\"col\">a</th><th scope=\"col\">b</th></tr></thead><tbody><tr><td>A</td><td>B</td></tr></tbody></table></div>",
element2?.innerHTML,
"Should render correct responsive table"
)