File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ export default () => {
25
25
afterOpenCallback . called . should . be . ok ( ) ;
26
26
} ) ;
27
27
28
+ it ( "should call onAfterOpen with overlay and content references" , ( ) => {
29
+ const afterOpenCallback = sinon . spy ( ) ;
30
+ const modal = renderModal ( { isOpen : true , onAfterOpen : afterOpenCallback } ) ;
31
+
32
+ sinon . assert . calledWith ( afterOpenCallback , {
33
+ overlayEl : modal . portal . overlay ,
34
+ contentEl : modal . portal . content
35
+ } ) ;
36
+ } ) ;
37
+
28
38
it ( "should trigger the onAfterClose callback" , ( ) => {
29
39
const onAfterCloseCallback = sinon . spy ( ) ;
30
40
const modal = renderModal ( {
Original file line number Diff line number Diff line change @@ -208,7 +208,10 @@ export default class ModalPortal extends Component {
208
208
this . setState ( { afterOpen : true } ) ;
209
209
210
210
if ( this . props . isOpen && this . props . onAfterOpen ) {
211
- this . props . onAfterOpen ( ) ;
211
+ this . props . onAfterOpen ( {
212
+ overlayEl : this . overlay ,
213
+ contentEl : this . content
214
+ } ) ;
212
215
}
213
216
} ) ;
214
217
}
You can’t perform that action at this time.
0 commit comments