@@ -144,6 +144,24 @@ describe('combobox-nav', function() {
144
144
assert . equal ( expectedTargets [ 1 ] , 'baymax' )
145
145
} )
146
146
147
+ it ( 'clear selection on input operation' , function ( ) {
148
+ press ( input , 'ArrowDown' )
149
+ assert . equal ( options [ 0 ] . getAttribute ( 'aria-selected' ) , 'true' )
150
+ assert . equal ( input . getAttribute ( 'aria-activedescendant' ) , 'baymax' )
151
+
152
+ press ( input , 'ArrowLeft' )
153
+ assert ( ! list . querySelector ( '[aria-selected=true]' ) , 'Nothing should be selected' )
154
+ assert ( ! input . hasAttribute ( 'aria-activedescendant' ) , 'Nothing should be selected' )
155
+
156
+ press ( input , 'ArrowDown' )
157
+ assert . equal ( options [ 0 ] . getAttribute ( 'aria-selected' ) , 'true' )
158
+ assert . equal ( input . getAttribute ( 'aria-activedescendant' ) , 'baymax' )
159
+
160
+ press ( input , 'Backspace' )
161
+ assert ( ! list . querySelector ( '[aria-selected=true]' ) , 'Nothing should be selected' )
162
+ assert ( ! input . hasAttribute ( 'aria-activedescendant' ) , 'Nothing should be selected' )
163
+ } )
164
+
147
165
it ( 'fires event and follows the link on click' , function ( ) {
148
166
let eventFired = false
149
167
document . addEventListener ( 'combobox-commit' , function ( ) {
0 commit comments