File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
src/frontend/apps/e2e/__tests__/app-impress Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,40 @@ test.describe('Doc Tree', () => {
303303 await expect ( docTree . getByText ( docChild ) ) . toBeVisible ( ) ;
304304 } ) ;
305305
306+ test ( 'keyboard navigation with F2 focuses root actions button' , async ( {
307+ page,
308+ browserName,
309+ } ) => {
310+ // Create a parent document to initialize the tree
311+ const [ docParent ] = await createDoc (
312+ page ,
313+ 'doc-tree-keyboard-f2-root' ,
314+ browserName ,
315+ 1 ,
316+ ) ;
317+ await verifyDocName ( page , docParent ) ;
318+
319+ const docTree = page . getByTestId ( 'doc-tree' ) ;
320+ await expect ( docTree ) . toBeVisible ( ) ;
321+
322+ const rootItem = page . getByTestId ( 'doc-tree-root-item' ) ;
323+ await expect ( rootItem ) . toBeVisible ( ) ;
324+
325+ // Focus the root item
326+ await rootItem . focus ( ) ;
327+ await expect ( rootItem ) . toBeFocused ( ) ;
328+
329+ // Press F2 → focus should move to the root actions \"More options\" button
330+ await page . keyboard . press ( 'F2' ) ;
331+
332+ const rootActions = rootItem . locator ( '.doc-tree-root-item-actions' ) ;
333+ const rootMoreOptionsButton = rootActions . getByRole ( 'button' , {
334+ name : / m o r e o p t i o n s / i,
335+ } ) ;
336+
337+ await expect ( rootMoreOptionsButton ) . toBeFocused ( ) ;
338+ } ) ;
339+
306340 test ( 'it updates the child icon from the tree' , async ( {
307341 page,
308342 browserName,
You can’t perform that action at this time.
0 commit comments