@@ -135,6 +135,17 @@ describe('List - Sortable', () => {
135
135
await expectAnnouncement ( 'Item moved from position 1 to position 2 of 3' ) ;
136
136
} ) ;
137
137
138
+ test ( 'ignores other keys' , async ( ) => {
139
+ const { wrapper } = renderSortableList ( ) ;
140
+ const dragHandle = wrapper . findItemByIndex ( 1 ) ! . findDragHandle ( ) ! . getElement ( ) ;
141
+ pressKey ( dragHandle , 'Space' ) ;
142
+ await expectAnnouncement ( 'Picked up item at position 1 of 3' ) ;
143
+ pressKey ( dragHandle , 'D' ) ;
144
+ pressKey ( dragHandle , 'Space' ) ;
145
+ expect ( wrapper . findItemByIndex ( 1 ) ! . getElement ( ) ) . toHaveTextContent ( 'Item 1' ) ;
146
+ expect ( wrapper . findItemByIndex ( 2 ) ! . getElement ( ) ) . toHaveTextContent ( 'Item 2' ) ;
147
+ } ) ;
148
+
138
149
test ( 'can move an item with UAP buttons' , async ( ) => {
139
150
const { wrapper } = renderSortableList ( ) ;
140
151
const dragHandle = wrapper . findItemByIndex ( 1 ) ! . findDragHandle ( ) ! . getElement ( ) ;
@@ -157,4 +168,14 @@ describe('List - Sortable', () => {
157
168
expect ( wrapper . findItemByIndex ( 2 ) ! . getElement ( ) ) . toHaveTextContent ( 'Item 1' ) ;
158
169
await expectAnnouncement ( 'Item moved from position 1 to position 2 of 3' ) ;
159
170
} ) ;
171
+
172
+ test ( 'non-primary pointer events do not activate UAP' , ( ) => {
173
+ const { wrapper } = renderSortableList ( ) ;
174
+ const dragHandle = wrapper . findItemByIndex ( 1 ) ! . findDragHandle ( ) ! ;
175
+ const dragWrapper = new InternalDragHandleWrapper ( document . body ) ;
176
+ expect ( dragWrapper . findVisibleDirectionButtonBlockEnd ( ) ) . toBeFalsy ( ) ;
177
+
178
+ dragHandle . click ( { button : 1 } ) ;
179
+ expect ( dragWrapper . findVisibleDirectionButtonBlockEnd ( ) ) . toBeFalsy ( ) ;
180
+ } ) ;
160
181
} ) ;
0 commit comments