-
Notifications
You must be signed in to change notification settings - Fork 1
/
dateinput_test.go
56 lines (46 loc) · 1.35 KB
/
dateinput_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
package goey
import (
"testing"
"time"
"bitbucket.org/rj/goey/base"
)
func TestDateInputMount(t *testing.T) {
v1 := time.Date(2006, time.January, 2, 0, 0, 0, 0, time.Local)
v2 := time.Date(2007, time.January, 2, 0, 0, 0, 0, time.Local)
testingMountWidgets(t,
&DateInput{Value: v1},
&DateInput{Value: v2, Disabled: true},
&DateInput{Value: v2},
)
}
func TestDateInputClose(t *testing.T) {
v1 := time.Date(2006, time.January, 2, 15, 4, 5, 0, time.Local)
v2 := time.Date(2007, time.January, 2, 15, 4, 5, 0, time.Local)
testingCloseWidgets(t,
&DateInput{Value: v1},
&DateInput{Value: v2, Disabled: true},
&DateInput{Value: v2},
)
}
func TestDateInputEvents(t *testing.T) {
v1 := time.Date(2006, time.January, 2, 15, 4, 5, 0, time.Local)
v2 := time.Date(2007, time.January, 2, 15, 4, 5, 0, time.Local)
testingCheckFocusAndBlur(t,
&DateInput{Value: v1},
&DateInput{Value: v2},
&DateInput{Value: v2},
)
}
func TestDateInputUpdateProps(t *testing.T) {
v1 := time.Date(2006, time.January, 2, 0, 0, 0, 0, time.Local)
v2 := time.Date(2007, time.January, 2, 0, 0, 0, 0, time.Local)
testingUpdateWidgets(t, []base.Widget{
&DateInput{Value: v1},
&DateInput{Value: v2, Disabled: true},
&DateInput{Value: v2},
}, []base.Widget{
&DateInput{Value: v2},
&DateInput{Value: v2, Disabled: false},
&DateInput{Value: v1, Disabled: true},
})
}