diff --git a/packages/components/src/navigator/test/index.tsx b/packages/components/src/navigator/test/index.tsx index a27be5475d802..5a711b8730224 100644 --- a/packages/components/src/navigator/test/index.tsx +++ b/packages/components/src/navigator/test/index.tsx @@ -22,6 +22,7 @@ import { NavigatorToParentButton, useNavigator, } from '..'; +import type { NavigateOptions } from '../types'; const INVALID_HTML_ATTRIBUTE = { raw: ' "\'><=invalid_path', @@ -57,6 +58,7 @@ const BUTTON_TEXT = { 'Navigate to screen with an invalid HTML value as a path.', back: 'Go back', backUsingGoTo: 'Go back using goTo', + goToWithSkipFocus: 'Go to with skipFocus', }; type CustomTestOnClickHandler = ( @@ -64,6 +66,7 @@ type CustomTestOnClickHandler = ( | { type: 'goTo'; path: string; + options?: NavigateOptions; } | { type: 'goBack' } | { type: 'goToParent' } @@ -108,6 +111,26 @@ function CustomNavigatorGoToBackButton( { ); } +function CustomNavigatorGoToSkipFocusButton( { + path, + onClick, + ...props +}: Omit< ComponentPropsWithoutRef< typeof NavigatorButton >, 'onClick' > & { + onClick?: CustomTestOnClickHandler; +} ) { + const { goTo } = useNavigator(); + return ( +