File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -417,6 +417,14 @@ export default () => {
417
417
unmountModal ( ) ;
418
418
} ) ;
419
419
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
+
420
428
it ( "raises an exception if the appElement selector does not match" , ( ) => {
421
429
should ( ( ) => ariaAppHider . setElement ( ".test" ) ) . throw ( ) ;
422
430
} ) ;
Original file line number Diff line number Diff line change @@ -348,6 +348,7 @@ export default class ModalPortal extends Component {
348
348
aria-label = { this . props . contentLabel }
349
349
{ ...this . attributesFromObject ( "aria" , this . props . aria || { } ) }
350
350
{ ...this . attributesFromObject ( "data" , this . props . data || { } ) }
351
+ data-testid = { this . props . testId }
351
352
>
352
353
{ this . props . children }
353
354
</ div >
You can’t perform that action at this time.
0 commit comments