File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
packages/devextreme/testing/tests/DevExpress.ui.events Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 11import eventsEngine from 'common/core/events/core/events_engine' ;
22import domAdapter from '__internal/core/m_dom_adapter' ;
33
4+ QUnit . testStart ( function ( ) {
5+ const markup = '' ;
6+ const fixture = document . getElementById ( 'qunit-fixture' ) ;
7+ if ( fixture ) {
8+ fixture . innerHTML = markup ;
9+ }
10+ } ) ;
11+
412QUnit . module ( 'event nodes disposing' , {
513 afterEach : function ( ) {
614 const document = domAdapter . getDocument ( ) ;
@@ -10,12 +18,22 @@ QUnit.module('event nodes disposing', {
1018
1119QUnit . test ( 'should not leak memory when clicking on body with dxclick subscription on document' , function ( assert ) {
1220 const document = domAdapter . getDocument ( ) ;
13- $ ( document ) . on ( 'dxclick' , function ( ) { } ) ;
21+ const body = document . body ;
22+
23+ eventsEngine . on ( document , 'dxclick' , function ( ) { } ) ;
24+
25+ if ( typeof globalThis !== 'undefined' && typeof globalThis . gc === 'function' ) {
26+ globalThis . gc ( ) ;
27+ }
1428
1529 const initialMemory = performance . memory . usedJSHeapSize ;
1630
1731 for ( let i = 0 ; i < 100 ; i ++ ) {
18- $ ( 'body' ) . trigger ( 'click' ) ;
32+ eventsEngine . trigger ( body , 'click' ) ;
33+ }
34+
35+ if ( typeof globalThis !== 'undefined' && typeof globalThis . gc === 'function' ) {
36+ globalThis . gc ( ) ;
1937 }
2038
2139 const finalMemory = performance . memory . usedJSHeapSize ;
You can’t perform that action at this time.
0 commit comments