@@ -7,13 +7,13 @@ test('click in input', async () => {
7
7
expect ( getEventCalls ( ) ) . toMatchInlineSnapshot ( `
8
8
Events fired on: input[value=""]
9
9
10
- mouseover: Left (0)
11
- mousemove: Left (0)
12
- mousedown: Left (0)
13
- focus
14
- focusin
15
- mouseup: Left (0)
16
- click: Left (0)
10
+ input[value=""] - mouseover: Left (0)
11
+ input[value=""] - mousemove: Left (0)
12
+ input[value=""] - mousedown: Left (0)
13
+ input[value=""] - focus
14
+ input[value=""] - focusin
15
+ input[value=""] - mouseup: Left (0)
16
+ input[value=""] - click: Left (0)
17
17
` )
18
18
} )
19
19
@@ -23,13 +23,13 @@ test('click in textarea', async () => {
23
23
expect ( getEventCalls ( ) ) . toMatchInlineSnapshot ( `
24
24
Events fired on: textarea[value=""]
25
25
26
- mouseover: Left (0)
27
- mousemove: Left (0)
28
- mousedown: Left (0)
29
- focus
30
- focusin
31
- mouseup: Left (0)
32
- click: Left (0)
26
+ textarea[value=""] - mouseover: Left (0)
27
+ textarea[value=""] - mousemove: Left (0)
28
+ textarea[value=""] - mousedown: Left (0)
29
+ textarea[value=""] - focus
30
+ textarea[value=""] - focusin
31
+ textarea[value=""] - mouseup: Left (0)
32
+ textarea[value=""] - click: Left (0)
33
33
` )
34
34
} )
35
35
@@ -40,14 +40,17 @@ test('should fire the correct events for <input type="checkbox">', async () => {
40
40
expect ( getEventCalls ( ) ) . toMatchInlineSnapshot ( `
41
41
Events fired on: input[checked=true]
42
42
43
- mouseover: Left (0)
44
- mousemove: Left (0)
45
- mousedown: Left (0)
46
- focus
47
- mouseup: Left (0)
48
- click: unchecked -> checked
49
- input: checked
50
- change
43
+ input[checked=false] - mouseover: Left (0)
44
+ input[checked=false] - mousemove: Left (0)
45
+ input[checked=false] - mousedown: Left (0)
46
+ input[checked=false] - focus
47
+ input[checked=false] - mouseup: Left (0)
48
+ input[checked=false] - click: Left (0)
49
+ unchecked -> checked
50
+ input[checked=false] - input
51
+ unchecked -> checked
52
+ input[checked=false] - change
53
+ unchecked -> checked
51
54
` )
52
55
} )
53
56
@@ -70,14 +73,17 @@ test('should fire the correct events for <input type="radio">', async () => {
70
73
expect ( getEventCalls ( ) ) . toMatchInlineSnapshot ( `
71
74
Events fired on: input[checked=true]
72
75
73
- mouseover: Left (0)
74
- mousemove: Left (0)
75
- mousedown: Left (0)
76
- focus
77
- mouseup: Left (0)
78
- click: unchecked -> checked
79
- input: checked
80
- change
76
+ input[checked=false] - mouseover: Left (0)
77
+ input[checked=false] - mousemove: Left (0)
78
+ input[checked=false] - mousedown: Left (0)
79
+ input[checked=false] - focus
80
+ input[checked=false] - mouseup: Left (0)
81
+ input[checked=false] - click: Left (0)
82
+ unchecked -> checked
83
+ input[checked=false] - input
84
+ unchecked -> checked
85
+ input[checked=false] - change
86
+ unchecked -> checked
81
87
` )
82
88
83
89
expect ( element ) . toHaveProperty ( 'checked' , true )
@@ -102,12 +108,12 @@ test('should fire the correct events for <div>', async () => {
102
108
expect ( getEventCalls ( ) ) . toMatchInlineSnapshot ( `
103
109
Events fired on: div
104
110
105
- mouseover: Left (0)
106
- mousemove: Left (0)
107
- mousedown: Left (0)
108
- focusin
109
- mouseup: Left (0)
110
- click: Left (0)
111
+ div - mouseover: Left (0)
112
+ div - mousemove: Left (0)
113
+ div - mousedown: Left (0)
114
+ div - focusin
115
+ div - mouseup: Left (0)
116
+ div - click: Left (0)
111
117
` )
112
118
} )
113
119
@@ -143,8 +149,15 @@ test('should blur the previous element', async () => {
143
149
expect ( getEventCalls ( ) ) . toMatchInlineSnapshot ( `
144
150
Events fired on: input[name="a"][value=""]
145
151
146
- blur
147
- focusout (bubbled from input[name="a"][value=""])
152
+ input[name="a"][value=""] - mouseover: Left (0)
153
+ input[name="a"][value=""] - mousemove: Left (0)
154
+ input[name="a"][value=""] - mousedown: Left (0)
155
+ input[name="a"][value=""] - focus
156
+ input[name="a"][value=""] - focusin
157
+ input[name="a"][value=""] - mouseup: Left (0)
158
+ input[name="a"][value=""] - click: Left (0)
159
+ input[name="a"][value=""] - blur
160
+ input[name="a"][value=""] - focusout
148
161
` )
149
162
} )
150
163
@@ -161,9 +174,17 @@ test('should not blur the previous element when mousedown prevents default', asy
161
174
await userEvent . click ( a )
162
175
clearEventCalls ( )
163
176
await userEvent . click ( b )
164
- expect ( getEventCalls ( ) ) . toMatchInlineSnapshot (
165
- `No events were fired on: input[name="a"][value=""]` ,
166
- )
177
+ expect ( getEventCalls ( ) ) . toMatchInlineSnapshot ( `
178
+ Events fired on: input[name="a"][value=""]
179
+
180
+ input[name="a"][value=""] - mouseover: Left (0)
181
+ input[name="a"][value=""] - mousemove: Left (0)
182
+ input[name="a"][value=""] - mousedown: Left (0)
183
+ input[name="a"][value=""] - focus
184
+ input[name="a"][value=""] - focusin
185
+ input[name="a"][value=""] - mouseup: Left (0)
186
+ input[name="a"][value=""] - click: Left (0)
187
+ ` )
167
188
} )
168
189
169
190
test ( 'does not lose focus when click updates focus' , async ( ) => {
0 commit comments