File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -417,6 +417,14 @@ export default () => {
417417 unmountModal ( ) ;
418418 } ) ;
419419
420+ it ( "additional testId attribute" , ( ) => {
421+ const modal = renderModal ( { isOpen : true , testId : "foo-bar" } , "hello" ) ;
422+ mcontent ( modal )
423+ . getAttribute ( "data-testid" )
424+ . should . be . eql ( "foo-bar" ) ;
425+ unmountModal ( ) ;
426+ } ) ;
427+
420428 it ( "raises an exception if the appElement selector does not match" , ( ) => {
421429 should ( ( ) => ariaAppHider . setElement ( ".test" ) ) . throw ( ) ;
422430 } ) ;
Original file line number Diff line number Diff line change @@ -348,6 +348,7 @@ export default class ModalPortal extends Component {
348348 aria-label = { this . props . contentLabel }
349349 { ...this . attributesFromObject ( "aria" , this . props . aria || { } ) }
350350 { ...this . attributesFromObject ( "data" , this . props . data || { } ) }
351+ data-testid = { this . props . testId }
351352 >
352353 { this . props . children }
353354 </ div >
You can’t perform that action at this time.
0 commit comments