@@ -429,6 +429,47 @@ export const KeyboardSelectionMultiSS = meta.story({
429429 play : kbMultiSelectionTest ( ' ' , ' ' ) ,
430430} ) ;
431431
432+ export const FullArrowNavigation = meta . story ( {
433+ play : async ( { canvas, step } ) => {
434+ const selectButton = await canvas . findByRole ( 'button' ) ;
435+ await step ( 'Open select' , async ( ) => {
436+ selectButton . focus ( ) ;
437+ await userEvent . keyboard ( '{ArrowDown}' ) ;
438+ expect ( selectButton ) . toHaveTextContent ( 'Tadpole' ) ;
439+ } ) ;
440+
441+ await step ( 'Navigate to option 2 with ArrowDown' , async ( ) => {
442+ await userEvent . keyboard ( '{ArrowDown}' ) ;
443+ expect ( selectButton ) . toHaveTextContent ( 'Pollywog' ) ;
444+ } ) ;
445+
446+ await step ( 'Navigate to option 3 with ArrowDown' , async ( ) => {
447+ await userEvent . keyboard ( '{ArrowDown}' ) ;
448+ expect ( selectButton ) . toHaveTextContent ( 'Frog' ) ;
449+ } ) ;
450+
451+ await step ( 'Loop back to option 1 with ArrowDown' , async ( ) => {
452+ await userEvent . keyboard ( '{ArrowDown}' ) ;
453+ expect ( selectButton ) . toHaveTextContent ( 'Tadpole' ) ;
454+ } ) ;
455+
456+ await step ( 'Navigate backwards with ArrowUp' , async ( ) => {
457+ await userEvent . keyboard ( '{ArrowUp}' ) ;
458+ expect ( selectButton ) . toHaveTextContent ( 'Frog' ) ;
459+ } ) ;
460+
461+ await step ( 'Navigate backwards with ArrowUp' , async ( ) => {
462+ await userEvent . keyboard ( '{ArrowUp}' ) ;
463+ expect ( selectButton ) . toHaveTextContent ( 'Pollywog' ) ;
464+ } ) ;
465+
466+ await step ( 'Navigate back to option 1 with ArrowUp' , async ( ) => {
467+ await userEvent . keyboard ( '{ArrowUp}' ) ;
468+ expect ( selectButton ) . toHaveTextContent ( 'Tadpole' ) ;
469+ } ) ;
470+ } ,
471+ } ) ;
472+
432473export const MouseOpenNoAutoselect = meta . story ( {
433474 name : 'AutoSelect - nothing selected on Mouse open (single)' ,
434475 play : async ( { canvas, args, step } ) => {
0 commit comments