Skip to content

Commit 0c94bde

Browse files
WIP. changes for check test
fix click subscription in events_engine (T1307313)
1 parent 2b439a5 commit 0c94bde

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

packages/devextreme/testing/tests/DevExpress.ui.events/event_nodes_disposing.tests.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import eventsEngine from 'common/core/events/core/events_engine';
22
import 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+
412
QUnit.module('event nodes disposing', {
513
afterEach: function() {
614
const document = domAdapter.getDocument();
@@ -10,12 +18,22 @@ QUnit.module('event nodes disposing', {
1018

1119
QUnit.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;

0 commit comments

Comments
 (0)