File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ describe('combobox-nav', function() {
51
51
<li id="hubot" role="option">Hubot</li>
52
52
<li id="r2-d2" role="option">R2-D2</li>
53
53
<li id="wall-e" role="option" aria-disabled="true">Wall-E</li>
54
+ <li><a href="#wall-e" role="option">Wall-E</a></li>
54
55
</ul>
55
56
`
56
57
comboboxNav . install ( document . querySelector ( 'input' ) , document . querySelector ( 'ul' ) )
@@ -120,5 +121,16 @@ describe('combobox-nav', function() {
120
121
assert . equal ( expectedTargets [ 0 ] , 'hubot' )
121
122
assert . equal ( expectedTargets [ 1 ] , 'baymax' )
122
123
} )
124
+
125
+ it ( 'fires event and follows the link on click' , function ( ) {
126
+ let eventFired = false
127
+ document . addEventListener ( 'combobox-commit' , function ( ) {
128
+ eventFired = true
129
+ } )
130
+
131
+ click ( document . querySelectorAll ( '[role=option]' ) [ 4 ] )
132
+ assert ( eventFired )
133
+ assert . equal ( window . location . hash , '#wall-e' )
134
+ } )
123
135
} )
124
136
} )
You can’t perform that action at this time.
0 commit comments