-
Notifications
You must be signed in to change notification settings - Fork 2
/
number-input_test.go
63 lines (44 loc) · 1.31 KB
/
number-input_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package goschemaform
import (
"testing"
)
func TestNumberInputDefaults(t *testing.T) {
input := NewNumberInput("test1")
input.SetTitle("Test 1")
t.Logf("Form:\n%s\n\nSchema:\n%s\n", input.Form(), input.Schema())
}
func TestNumberInputMinimum(t *testing.T) {
input := NewNumberInput("test1")
input.SetTitle("Test 1")
input.SetMin(0)
t.Logf("Form:\n%s\n\nSchema:\n%s\n", input.Form(), input.Schema())
}
func TestNumberInputMaximum(t *testing.T) {
input := NewNumberInput("test1")
input.SetTitle("Test 1")
input.SetMax(10)
t.Logf("Form:\n%s\n\nSchema:\n%s\n", input.Form(), input.Schema())
}
func TestNumberInputMinMax(t *testing.T) {
input := NewNumberInput("test1")
input.SetTitle("Test 1")
input.SetMin(-10)
input.SetMax(5)
t.Logf("Form:\n%s\n\nSchema:\n%s\n", input.Form(), input.Schema())
}
func TestNumberInputMinMaxCondition(t *testing.T) {
input := NewNumberInput("test1")
input.SetTitle("Test 1")
input.SetMin(-10)
input.SetMax(5)
input.SetCondition("check2", false)
t.Logf("Form:\n%s\n\nSchema:\n%s\n", input.Form(), input.Schema())
}
func TestNumberInputMinMaxConditionFlip(t *testing.T) {
input := NewNumberInput("test1")
input.SetTitle("Test 1")
input.SetMin(-10)
input.SetMax(5)
input.SetCondition("check2", true)
t.Logf("Form:\n%s\n\nSchema:\n%s\n", input.Form(), input.Schema())
}