Skip to content

Commit

Permalink
Fix tests on GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rjaros committed Dec 30, 2022
1 parent 805a3e6 commit c39696b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ class NumericInputSpec : DomSpec {
fun render() {
run {
val root = Root("test", containerType = io.kvision.panel.ContainerType.FIXED)
val ri = NumericInput(12, decimals = 3).apply {
val ri = NumericInput(12, decimals = 3, decimalSeparator = '.').apply {
name = "name"
id = "idri"
disabled = true
}
root.add(ri)
val element = document.getElementById("test")
assertEqualsHtml(
"<input class=\"form-control\" id=\"idri\" type=\"text\" maxlength=\"14\" pattern=\"^-?(\\d+(,\\d{1,3})?)\$\" value=\"12\" name=\"name\" disabled=\"disabled\">",
"<input class=\"form-control\" id=\"idri\" type=\"text\" maxlength=\"14\" pattern=\"^-?(\\d+(\\.\\d{1,3})?)\$\" value=\"12\" name=\"name\" disabled=\"disabled\">",
element?.innerHTML,
"Should render correct numeric input control"
)
Expand Down
4 changes: 2 additions & 2 deletions src/test/kotlin/test/io/kvision/form/number/NumericSpec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ class NumericSpec : DomSpec {
fun render() {
run {
val root = Root("test", containerType = io.kvision.panel.ContainerType.FIXED)
val numeric = Numeric(12, "name", decimals = 2, label = "Label").apply {
val numeric = Numeric(12, "name", decimals = 2, label = "Label", decimalSeparator = '.').apply {
id = "idri"
disabled = true
}
root.add(numeric)
val element = document.getElementById("test")
val id = numeric.input.id
assertEqualsHtml(
"<div class=\"form-group kv-mb-3\" id=\"idri\"><label class=\"form-label\" for=\"$id\">Label</label><input class=\"form-control\" id=\"$id\" type=\"text\" maxlength=\"14\" pattern=\"^-?(\\d+(,\\d{1,2})?)\$\" value=\"12\" name=\"name\" disabled=\"disabled\"></div>",
"<div class=\"form-group kv-mb-3\" id=\"idri\"><label class=\"form-label\" for=\"$id\">Label</label><input class=\"form-control\" id=\"$id\" type=\"text\" maxlength=\"14\" pattern=\"^-?(\\d+(\\.\\d{1,2})?)\$\" value=\"12\" name=\"name\" disabled=\"disabled\"></div>",
element?.innerHTML,
"Should render correct numeric form control"
)
Expand Down

0 comments on commit c39696b

Please sign in to comment.