@@ -273,6 +273,41 @@ QUnit.module('Rendering', moduleConfig, () => {
273273 } ) ;
274274} ) ;
275275
276+ QUnit . module ( 'Repaint' , moduleConfig , ( ) => {
277+ QUnit . test ( 'On repaint all submenus should be hidden without console errors (T1257288)' , function ( assert ) {
278+ if ( ! isDeviceDesktop ( assert ) ) {
279+ return ;
280+ }
281+
282+ const instance = new ContextMenu ( this . $element , {
283+ items : [ { text : 'Item 1' , items : [ { text : 'Item 11' } , { text : 'Item 12' } ] } ] ,
284+ visible : true ,
285+ showSubmenuMode : { name : 'onHover' , delay : 0 } ,
286+ onItemClick : ( e ) => e . component . repaint ( ) ,
287+ } ) ;
288+
289+ const $itemsContainer = instance . itemsContainer ( ) ;
290+ const $rootItem = $itemsContainer . find ( `.${ DX_MENU_ITEM_CLASS } ` ) . eq ( 0 ) ;
291+
292+ $ ( $itemsContainer ) . trigger ( $ . Event ( 'dxhoverstart' , { target : $rootItem . get ( 0 ) } ) ) ;
293+ this . clock . tick ( 0 ) ;
294+
295+ const $submenus = $ ( `.${ DX_SUBMENU_CLASS } ` ) ;
296+ const $nestedSubmenu = $submenus . eq ( 1 ) ;
297+ const $nestedSubmenuItem = $nestedSubmenu . find ( `.${ DX_MENU_ITEM_CLASS } ` ) . eq ( 0 ) ;
298+
299+ assert . strictEqual ( $submenus . length , 2 , 'Nested submenu is shown' ) ;
300+
301+ try {
302+ $ ( $nestedSubmenuItem ) . trigger ( 'dxclick' ) ;
303+
304+ assert . ok ( true , 'No errors were thrown' ) ;
305+ } catch ( e ) {
306+ assert . ok ( false , `Error: ${ e . message } ` ) ;
307+ }
308+ } ) ;
309+ } ) ;
310+
276311QUnit . module ( 'Rendering Scrollable' , moduleConfig , ( ) => {
277312 const DX_SCROLLABLE_CLASS = 'dx-scrollable' ;
278313 const DX_SCROLLABLE_CONTAINER_CLASS = 'dx-scrollable-container' ;
0 commit comments