@@ -225,42 +225,6 @@ describe('ActionMenu', () => {
225225 expect ( component . getByLabelText ( 'Clear Group by' ) ) . toHaveAttribute ( 'role' , 'menuitem' )
226226 } )
227227
228- // TODO: Fix the focus trap from taking over focus control
229- // https://github.com/primer/react/issues/6434
230- it . skip ( 'should keep focus on Button when menu is opened with click' , async ( ) => {
231- const component = HTMLRender ( < Example /> )
232- const button = component . getByRole ( 'button' )
233-
234- const user = userEvent . setup ( )
235- await user . tab ( ) // tab into the story, this should focus on the first button
236- expect ( button ) . toEqual ( document . activeElement ) // trust, but verify
237-
238- await user . click ( button )
239- expect ( component . queryByRole ( 'menu' ) ) . toBeInTheDocument ( )
240- expect ( document . activeElement ) . toEqual ( button )
241- } )
242-
243- // TODO: Fix the focus trap from taking over focus control
244- // https://github.com/primer/react/issues/6434
245- it . skip ( 'should select first element when ArrowDown is pressed after opening Menu with click' , async ( ) => {
246- const component = HTMLRender ( < Example /> )
247- const button = component . getByRole ( 'button' )
248-
249- const user = userEvent . setup ( )
250- await act ( async ( ) => {
251- await user . click ( button )
252- } )
253-
254- expect ( component . queryByRole ( 'menu' ) ) . toBeInTheDocument ( )
255-
256- await act ( async ( ) => {
257- // assumes button is the active element at this point
258- await user . keyboard ( '{ArrowDown}' )
259- } )
260-
261- expect ( component . getAllByRole ( 'menuitem' ) [ 0 ] ) . toEqual ( document . activeElement )
262- } )
263-
264228 it ( 'should be able to select an Item with aria-keyshortcuts after opening Menu with click' , async ( ) => {
265229 const component = HTMLRender ( < Example /> )
266230 const button = component . getByRole ( 'button' )
0 commit comments