@@ -94,29 +94,29 @@ defmodule Scenic.Component.Input.TextFieldTest do
94
94
:_pong_ = GenServer . call ( vp_pid , :_ping_ )
95
95
end
96
96
97
- test "press_in captures, starts editing and fire focus_in event" , % { vp: vp , pid: pid } do
97
+ test "press_in captures, starts editing and fire focus event" , % { vp: vp , pid: pid } do
98
98
assert Input . fetch_captures! ( vp ) == { :ok , [ ] }
99
99
Input . send ( vp , @ press_in )
100
100
force_sync ( vp . pid , pid )
101
101
102
102
assert Input . fetch_captures! ( vp ) ~> { :ok , sorted_list ( [ :codepoint , :cursor_button , :key ] ) }
103
- assert_receive ( { :fwd_event , { :focus_in , :text_field } } , 200 )
103
+ assert_receive ( { :fwd_event , { :focus , :text_field } } , 200 )
104
104
105
105
Input . send ( vp , @ cp_k )
106
106
assert_receive ( { :fwd_event , { :value_changed , :text_field , "kInitial value" } } , 200 )
107
107
end
108
108
109
- test "press_out releases, ends editing and fire focus_out event" , % { vp: vp , pid: pid } do
109
+ test "press_out releases, ends editing and fire blur event" , % { vp: vp , pid: pid } do
110
110
Input . send ( vp , @ press_in )
111
111
force_sync ( vp . pid , pid )
112
112
113
113
assert Input . fetch_captures! ( vp ) ~> { :ok , sorted_list ( [ :codepoint , :cursor_button , :key ] ) }
114
- assert_receive ( { :fwd_event , { :focus_in , :text_field } } , 200 )
114
+ assert_receive ( { :fwd_event , { :focus , :text_field } } , 200 )
115
115
116
116
Input . send ( vp , @ press_out )
117
117
force_sync ( vp . pid , pid )
118
118
assert Input . fetch_captures! ( vp ) == { :ok , [ ] }
119
- assert_receive ( { :fwd_event , { :focus_out , :text_field } } , 200 )
119
+ assert_receive ( { :fwd_event , { :blur , :text_field } } , 200 )
120
120
121
121
Input . send ( vp , @ cp_k )
122
122
refute_receive ( _ , 10 )
@@ -125,7 +125,7 @@ defmodule Scenic.Component.Input.TextFieldTest do
125
125
test "pressing in the field moves the cursor to the nearst character gap" , % { vp: vp , pid: pid } do
126
126
Input . send ( vp , @ press_in )
127
127
force_sync ( vp . pid , pid )
128
- assert_receive ( { :fwd_event , { :focus_in , :text_field } } , 200 )
128
+ assert_receive ( { :fwd_event , { :focus , :text_field } } , 200 )
129
129
130
130
Input . send ( vp , @ cp_k )
131
131
assert_receive ( { :fwd_event , { :value_changed , :text_field , "kInitial value" } } , 200 )
@@ -206,7 +206,7 @@ defmodule Scenic.Component.Input.TextFieldTest do
206
206
test "backspace does nothing at the start of the string" , % { vp: vp , pid: pid } do
207
207
Input . send ( vp , @ press_in )
208
208
force_sync ( vp . pid , pid )
209
- assert_receive ( { :fwd_event , { :focus_in , :text_field } } , 200 )
209
+ assert_receive ( { :fwd_event , { :focus , :text_field } } , 200 )
210
210
211
211
Input . send ( vp , @ key_backspace )
212
212
refute_receive ( _ , 10 )
@@ -223,7 +223,7 @@ defmodule Scenic.Component.Input.TextFieldTest do
223
223
test "delete does nothing at the end of the field" , % { vp: vp , pid: pid } do
224
224
Input . send ( vp , @ press_in )
225
225
force_sync ( vp . pid , pid )
226
- assert_receive ( { :fwd_event , { :focus_in , :text_field } } , 200 )
226
+ assert_receive ( { :fwd_event , { :focus , :text_field } } , 200 )
227
227
228
228
Input . send ( vp , @ key_end )
229
229
Input . send ( vp , @ key_delete )
@@ -236,7 +236,7 @@ defmodule Scenic.Component.Input.TextFieldTest do
236
236
237
237
Input . send ( vp , { :cursor_button , { :btn_left , 1 , [ ] , { 20 , 60 } } } )
238
238
force_sync ( vp . pid , pid )
239
- assert_receive ( { :fwd_event , { :focus_in , :number_field } } , 200 )
239
+ assert_receive ( { :fwd_event , { :focus , :number_field } } , 200 )
240
240
241
241
Input . send ( vp , { :codepoint , { "a" , [ ] } } )
242
242
refute_receive ( _ , 10 )
@@ -256,7 +256,7 @@ defmodule Scenic.Component.Input.TextFieldTest do
256
256
257
257
Input . send ( vp , { :cursor_button , { :btn_left , 1 , [ ] , { 14 , 86 } } } )
258
258
force_sync ( vp . pid , pid )
259
- assert_receive ( { :fwd_event , { :focus_in , :integer_field } } , 200 )
259
+ assert_receive ( { :fwd_event , { :focus , :integer_field } } , 200 )
260
260
261
261
Input . send ( vp , { :codepoint , { "a" , [ ] } } )
262
262
refute_receive ( _ , 10 )
@@ -276,7 +276,7 @@ defmodule Scenic.Component.Input.TextFieldTest do
276
276
277
277
Input . send ( vp , { :cursor_button , { :btn_left , 1 , [ ] , { 14 , 121 } } } )
278
278
force_sync ( vp . pid , pid )
279
- assert_receive ( { :fwd_event , { :focus_in , :abcdefg_field } } , 200 )
279
+ assert_receive ( { :fwd_event , { :focus , :abcdefg_field } } , 200 )
280
280
281
281
Input . send ( vp , { :codepoint , { "a" , [ ] } } )
282
282
assert_receive ( { :fwd_event , { :value_changed , :abcdefg_field , "a" } } , 200 )
@@ -294,7 +294,7 @@ defmodule Scenic.Component.Input.TextFieldTest do
294
294
295
295
Input . send ( vp , { :cursor_button , { :btn_left , 1 , [ ] , { 14 , 171 } } } )
296
296
force_sync ( vp . pid , pid )
297
- assert_receive ( { :fwd_event , { :focus_in , :fn_field } } , 200 )
297
+ assert_receive ( { :fwd_event , { :focus , :fn_field } } , 200 )
298
298
299
299
Input . send ( vp , { :codepoint , { "a" , [ ] } } )
300
300
refute_receive ( _ , 10 )
0 commit comments