@@ -41,7 +41,7 @@ describe('features/create-append-anything - append menu provider', function() {
4141 // when
4242 contextPad . trigger ( 'click' , padEvent ( 'append' ) ) ;
4343
44- const padMenuRect = contextPad . getPad ( element ) . html . getBoundingClientRect ( ) ;
44+ const padMenuRect = getPad ( ) . getBoundingClientRect ( ) ;
4545 const replaceMenuRect = getPopupMenu ( ) . getBoundingClientRect ( ) ;
4646
4747 // then
@@ -64,7 +64,7 @@ describe('features/create-append-anything - append menu provider', function() {
6464 // when
6565 contextPad . open ( element ) ;
6666
67- const padNode = contextPad . getPad ( element ) . html ;
67+ const padNode = getPad ( ) ;
6868
6969 // then
7070 expect ( padEntry ( padNode , 'append' ) ) . not . to . exist ;
@@ -86,7 +86,7 @@ describe('features/create-append-anything - append menu provider', function() {
8686 // when
8787 contextPad . open ( element ) ;
8888
89- const padNode = contextPad . getPad ( element ) . html ;
89+ const padNode = getPad ( ) ;
9090
9191 // then
9292 expect ( padEntry ( padNode , 'append' ) ) . to . exist ;
@@ -103,17 +103,19 @@ function padEntry(element, name) {
103103}
104104
105105function padEvent ( entry ) {
106+ const target = padEntry ( getPad ( ) , entry ) ;
107+
108+ return {
109+ target : target ,
110+ preventDefault : function ( ) { } ,
111+ clientX : 100 ,
112+ clientY : 100
113+ } ;
114+ }
106115
107- return getBpmnJS ( ) . invoke ( function ( overlays ) {
108-
109- const target = padEntry ( overlays . _overlayRoot , entry ) ;
110-
111- return {
112- target : target ,
113- preventDefault : function ( ) { } ,
114- clientX : 100 ,
115- clientY : 100
116- } ;
116+ function getPad ( ) {
117+ return getBpmnJS ( ) . invoke ( function ( canvas ) {
118+ return canvas . getContainer ( ) . querySelector ( '.djs-context-pad' ) ;
117119 } ) ;
118120}
119121
0 commit comments