@@ -56,6 +56,7 @@ export type InternalButtonProps = Omit<ButtonProps, 'variant'> & {
5656 __title ?: string ;
5757 __emitPerformanceMarks ?: boolean ;
5858 __skipNativeAttributesWarnings ?: boolean ;
59+ __hideFromTestUtils ?: boolean ;
5960} & InternalBaseComponentProps ;
6061
6162export const InternalButton = React . forwardRef (
@@ -98,6 +99,7 @@ export const InternalButton = React.forwardRef(
9899 __title,
99100 __emitPerformanceMarks = true ,
100101 __skipNativeAttributesWarnings,
102+ __hideFromTestUtils = false ,
101103 analyticsAction = 'click' ,
102104 ...props
103105 } : InternalButtonProps ,
@@ -178,7 +180,8 @@ export const InternalButton = React.forwardRef(
178180 buttonContext . onClick ( { variant } ) ;
179181 } ;
180182
181- const buttonClass = clsx ( props . className , styles . button , styles [ `variant-${ variant } ` ] , {
183+ const buttonClass = clsx ( props . className , styles . root , styles [ `variant-${ variant } ` ] , {
184+ [ testUtilStyles . root ] : ! __hideFromTestUtils ,
182185 [ styles . disabled ] : isNotInteractive ,
183186 [ styles [ 'disabled-with-reason' ] ] : isDisabledWithReason ,
184187 [ styles [ 'button-no-wrap' ] ] : ! wrapText ,
0 commit comments