File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,29 @@ describe('remote-input', function() {
25
25
document . body . innerHTML = ''
26
26
} )
27
27
28
+ it ( 'emits network events in order' , async function ( ) {
29
+ const remoteInput = document . querySelector ( 'remote-input' )
30
+ const input = document . querySelector ( 'input' )
31
+
32
+ const events = [ ]
33
+ const track = event => events . push ( event . type )
34
+
35
+ remoteInput . addEventListener ( 'loadstart' , track )
36
+ remoteInput . addEventListener ( 'load' , track )
37
+ remoteInput . addEventListener ( 'loadend' , track )
38
+
39
+ const completed = Promise . all ( [
40
+ once ( remoteInput , 'loadstart' ) ,
41
+ once ( remoteInput , 'load' ) ,
42
+ once ( remoteInput , 'loadend' )
43
+ ] )
44
+ input . value = 'test'
45
+ input . focus ( )
46
+ await completed
47
+
48
+ assert . deepEqual ( [ 'loadstart' , 'load' , 'loadend' ] , events )
49
+ } )
50
+
28
51
it ( 'loads content' , async function ( ) {
29
52
const remoteInput = document . querySelector ( 'remote-input' )
30
53
const input = document . querySelector ( 'input' )
You can’t perform that action at this time.
0 commit comments