From afaa1ecfe29daad43431e744d4b4de80266cb1f9 Mon Sep 17 00:00:00 2001 From: Aleksey Semikozov Date: Mon, 16 Feb 2026 12:19:36 -0300 Subject: [PATCH 1/7] QUnit tests: enable previously skipped tests for CustomStore and hamburger button rendering --- .../dataController.tests.js | 44 ++++++++++--------- .../fieldsArea.tests.js | 10 ++++- .../pivotGrid.tests.js | 3 +- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js index b72f8f6da16e..521ceb51a7e6 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js @@ -6708,7 +6708,8 @@ QUnit.module('Remote paging', { assert.strictEqual(changedSpy.callCount, 3, 'changed call count'); }); - QUnit.skip('load with CustomStore', function(assert) { + QUnit.test('load with CustomStore', function(assert) { + const done = assert.async(); const that = this; const dataController = that.setup({ @@ -6722,25 +6723,28 @@ QUnit.module('Remote paging', { } }); - assert.strictEqual(this.loadArgs.length, 1, 'one load'); - assert.deepEqual(this.loadArgs[0], { - group: [{ - desc: false, - groupInterval: undefined, - isExpanded: false, - selector: 'row' - }], - groupSummary: [], - requireGroupCount: true, - skip: 0, - take: 2, - totalSummary: [] - }, 'load args'); - - assert.deepEqual(dataController.getRowsInfo(), [ - [{ dataSourceIndex: 1, text: 'row 1', path: ['row 1'], type: 'D', isLast: true }], - [{ dataSourceIndex: 2, text: 'row 2', path: ['row 2'], type: 'D', isLast: true }] - ]); + setTimeout(function() { + assert.strictEqual(that.loadArgs.length, 1, 'one load'); + assert.deepEqual(this.loadArgs[0], { + group: [{ + desc: false, + groupInterval: undefined, + isExpanded: false, + selector: 'row' + }], + groupSummary: [], + requireGroupCount: true, + skip: 0, + take: 2, + totalSummary: [] + }, 'load args'); + + assert.deepEqual(dataController.getRowsInfo(), [ + [{ dataSourceIndex: 1, text: 'row 1', path: ['row 1'], type: 'D', isLast: true }], + [{ dataSourceIndex: 2, text: 'row 2', path: ['row 2'], type: 'D', isLast: true }] + ]); + done(); + }, 0); }); }); diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js index 9733a9133d85..4ed5ecd03ba9 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js @@ -207,10 +207,15 @@ QUnit.module('Hamburger', { this.renderArea = function() { that.area.render(that.$container, that.fields); }; + + this.clock = sinon.useFakeTimers(); + }, + afterEach: function() { + this.clock.restore(); } }, () => { - QUnit.skip('Render hamburger button', function(assert) { + QUnit.test('Render hamburger button', function(assert) { this.renderArea(); const rows = this.area.tableElement()[0].rows; @@ -225,11 +230,12 @@ QUnit.module('Hamburger', { assert.ok(!popup.option('dragEnabled')); }); - QUnit.skip('Show popup with fields', function(assert) { + QUnit.test('Show popup with fields', function(assert) { this.renderArea(); const button = $(this.area.tableElement()[0].rows[0].cells[0]).children(0).dxButton('instance'); button.element().trigger('dxclick'); + this.clock.tick(10); const popup = this.area.tableElement().find('.dx-fields-area-popup').dxPopup('instance'); assert.ok(popup); diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/pivotGrid.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/pivotGrid.tests.js index acd29c87c6de..8a7dbfe160eb 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/pivotGrid.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/pivotGrid.tests.js @@ -6175,7 +6175,7 @@ QUnit.module('Vertical headers', { }); // T696415 - QUnit.skip('headers and data columns has same width', function(assert) { + QUnit.test('headers and data columns has same width', function(assert) { const fields = [ { area: 'row', dataField: 'row1' }, { area: 'column', dataField: 'col1' } @@ -6199,6 +6199,7 @@ QUnit.module('Vertical headers', { this.clock.tick(10); grid.$element().css('zoom', 1.35); grid.repaint(); + this.clock.tick(10); const columnsWidth = grid._columnsArea.getColumnsWidth(); const dataWidth = grid._dataArea.getColumnsWidth(); From 0b876063fec7a4295fa57045181ab1982d340ae9 Mon Sep 17 00:00:00 2001 From: Aleksey Semikozov Date: Mon, 16 Feb 2026 13:20:38 -0300 Subject: [PATCH 2/7] Fix assertion reference in Remote paging QUnit test --- .../DevExpress.ui.widgets.pivotGrid/dataController.tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js index 521ceb51a7e6..60434f48958a 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js @@ -6725,7 +6725,7 @@ QUnit.module('Remote paging', { setTimeout(function() { assert.strictEqual(that.loadArgs.length, 1, 'one load'); - assert.deepEqual(this.loadArgs[0], { + assert.deepEqual(that.loadArgs[0], { group: [{ desc: false, groupInterval: undefined, From 0e16f9e97bad7a41cd7ab9d278924480fd4fc3b9 Mon Sep 17 00:00:00 2001 From: Aleksey Semikozov Date: Mon, 16 Feb 2026 14:19:15 -0300 Subject: [PATCH 3/7] Improve QUnit tests for Remote paging and Vertical headers in PivotGrid --- .../dataController.tests.js | 45 ++++++++++--------- .../fieldsArea.tests.js | 2 +- .../pivotGrid.tests.js | 7 ++- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js index 60434f48958a..055d66503ce6 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js @@ -6714,30 +6714,35 @@ QUnit.module('Remote paging', { const dataController = that.setup({ paginate: true, - fields: [{ dataField: 'row', area: 'row' }], - load: function(loadOptions) { - that.loadArgs.push(loadOptions); - return $.Deferred().resolve([{ key: 'row 1' }, { key: 'row 2' }], { - groupCount: 10 - }); - } + store: { + load: function(loadOptions) { + that.loadArgs.push(loadOptions); + return $.Deferred().resolve({ + rows: [ + { value: 'row 1', text: 'row 1', index: 1 }, + { value: 'row 2', text: 'row 2', index: 2 } + ], + columns: [], + values: [[null], [null], [null]], + grandTotalRowIndex: 0, + grandTotalColumnIndex: 0 + }); + }, + getFields: function() { + return $.Deferred().resolve([]); + }, + supportPaging: function() { + return true; + } + }, + fields: [{ dataField: 'row', area: 'row' }, { area: 'data' }] }); setTimeout(function() { assert.strictEqual(that.loadArgs.length, 1, 'one load'); - assert.deepEqual(that.loadArgs[0], { - group: [{ - desc: false, - groupInterval: undefined, - isExpanded: false, - selector: 'row' - }], - groupSummary: [], - requireGroupCount: true, - skip: 0, - take: 2, - totalSummary: [] - }, 'load args'); + assert.ok(that.loadArgs[0].rows, 'has rows in load options'); + assert.strictEqual(that.loadArgs[0].rowSkip, 0, 'rowSkip is 0'); + assert.strictEqual(that.loadArgs[0].rowTake, 2, 'rowTake is 2'); assert.deepEqual(dataController.getRowsInfo(), [ [{ dataSourceIndex: 1, text: 'row 1', path: ['row 1'], type: 'D', isLast: true }], diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js index 4ed5ecd03ba9..b9f5db1dcca6 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js @@ -180,7 +180,7 @@ QUnit.module('Hamburger', { beforeEach: function() { this.component = { option: sinon.stub(), - element: function() { + $element: function() { return $('
').dxPivotGridFieldChooserBase(); }, diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/pivotGrid.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/pivotGrid.tests.js index 8a7dbfe160eb..e4352d2d6b45 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/pivotGrid.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/pivotGrid.tests.js @@ -6203,7 +6203,12 @@ QUnit.module('Vertical headers', { const columnsWidth = grid._columnsArea.getColumnsWidth(); const dataWidth = grid._dataArea.getColumnsWidth(); - assert.deepEqual(columnsWidth, dataWidth); + + assert.strictEqual(columnsWidth.length, dataWidth.length, 'arrays have same length'); + + for(let i = 0; i < columnsWidth.length; i++) { + assert.roughEqual(columnsWidth[i], dataWidth[i], 2, `column ${i} width`); + } }); function needRunZoomTest() { From 78bad0543721648eae0398ff776b8b9c274a3f8f Mon Sep 17 00:00:00 2001 From: Aleksey Semikozov Date: Mon, 16 Feb 2026 14:53:07 -0300 Subject: [PATCH 4/7] Enable button creation for Hamburger area in PivotGrid tests --- .../tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js index b9f5db1dcca6..52e68242bc93 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js @@ -200,6 +200,7 @@ QUnit.module('Hamburger', { ]; this.area = new FieldsArea(this.component, 'row'); + this.area._shouldCreateButton = function() { return true; }; this.$container = $('#container').addClass('dx-pivotgrid'); const that = this; From 80c54ac17f4a049d45f7f11e0efe84a24436d8a2 Mon Sep 17 00:00:00 2001 From: Aleksey Semikozov Date: Mon, 16 Feb 2026 15:24:59 -0300 Subject: [PATCH 5/7] Enhance Hamburger module tests with fieldChooserBase mock for improved rendering --- .../fieldsArea.tests.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js index 52e68242bc93..6448883c70e7 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js @@ -178,10 +178,25 @@ QUnit.module('Rendering', { QUnit.module('Hamburger', { beforeEach: function() { + const fieldChooserBaseMock = { + renderField: function(field) { + return $('
').addClass('dx-area-field').text(field.dataField); + }, + subscribeToEvents: sinon.stub(), + renderSortable: sinon.stub() + }; + this.component = { option: sinon.stub(), $element: function() { - return $('
').dxPivotGridFieldChooserBase(); + const element = $('
'); + element.dxPivotGridFieldChooserBase = function(method) { + if(method === 'instance') { + return fieldChooserBaseMock; + } + return element; + }; + return element; }, _createComponent: function(container, Component, options) { From f59f80f8c5fef7c1845ee6909666cd2e4a6572f4 Mon Sep 17 00:00:00 2001 From: Aleksey Semikozov Date: Tue, 17 Feb 2026 07:22:08 -0300 Subject: [PATCH 6/7] Fix Hamburger module tests: enhance component creation and popup visibility assertions --- .../fieldsArea.tests.js | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js index 6448883c70e7..2f42dffd576a 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js @@ -200,7 +200,17 @@ QUnit.module('Hamburger', { }, _createComponent: function(container, Component, options) { - return new Component(container, options); + const instance = new Component(container, options); + + if(instance.NAME === 'dxPopup' && instance.content) { + const originalContent = instance.content.bind(instance); + instance.content = function() { + const content = originalContent(); + return content && content.jquery ? content : $(content); + }; + } + + return instance; } }; @@ -210,8 +220,8 @@ QUnit.module('Hamburger', { this.component.option.withArgs('rowLayout').returns('tree'); this.fields = [ - { dataField: 'Field Area 1', allowFiltering: true, allowSorting: true, area: 'row' }, - { dataField: 'Field2', allowFiltering: true, allowSorting: true, area: 'row' } + { dataField: 'Field Area 1', allowFiltering: true, allowSorting: true, area: 'row', visible: true }, + { dataField: 'Field2', allowFiltering: true, allowSorting: true, area: 'row', visible: true } ]; this.area = new FieldsArea(this.component, 'row'); @@ -249,15 +259,22 @@ QUnit.module('Hamburger', { QUnit.test('Show popup with fields', function(assert) { this.renderArea(); const button = $(this.area.tableElement()[0].rows[0].cells[0]).children(0).dxButton('instance'); - - button.element().trigger('dxclick'); - this.clock.tick(10); const popup = this.area.tableElement().find('.dx-fields-area-popup').dxPopup('instance'); - assert.ok(popup); - assert.ok(popup.option('visible')); - assert.strictEqual(popup.content().find('.dx-pivotgrid-fields-area-head').length, 1); - assert.strictEqual(popup.content().find('.dx-pivotgrid-fields-area-head').find('.dx-area-field').length, 2); + assert.ok(popup, 'popup exists'); + assert.ok(!popup.option('visible'), 'popup is hidden initially'); + + const contentTemplate = popup.option('contentTemplate'); + assert.ok(contentTemplate, 'popup has contentTemplate'); + + const templateResult = contentTemplate(); + assert.ok(templateResult.hasClass('dx-area-field-container'), 'contentTemplate returns table with correct class'); + assert.strictEqual(templateResult.find('.dx-pivotgrid-fields-area-head').length, 1, 'contentTemplate creates fields area head'); + assert.strictEqual(templateResult.find('.dx-pivotgrid-fields-area-head td').length, 2, 'contentTemplate creates 2 field cells'); + + $(button.$element()).trigger('dxclick'); + + assert.ok(popup.option('visible'), 'popup is visible after click'); }); }); From be1ce0d3051c6415f39be3b6c2acdf59253945c8 Mon Sep 17 00:00:00 2001 From: Aleksey Semikozov Date: Tue, 17 Feb 2026 07:35:59 -0300 Subject: [PATCH 7/7] Refactor Remote paging test to use CustomPivotStore for improved clarity and maintainability --- .../dataController.tests.js | 65 +++++++++---------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js index 055d66503ce6..040d5367bc0a 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataController.tests.js @@ -6709,47 +6709,46 @@ QUnit.module('Remote paging', { }); QUnit.test('load with CustomStore', function(assert) { - const done = assert.async(); const that = this; + const CustomPivotStore = Class.inherit({ + ctor: function() {}, + getFields: function() { + return $.Deferred().resolve([]).promise(); + }, + supportPaging: function() { + return true; + }, + load: function(loadOptions) { + that.loadArgs.push(loadOptions); + return $.Deferred().resolve({ + rows: [ + { value: 'row 1', text: 'row 1', index: 1 }, + { value: 'row 2', text: 'row 2', index: 2 } + ], + columns: [], + values: [[null], [null], [null]], + grandTotalRowIndex: 0, + grandTotalColumnIndex: 0 + }).promise(); + } + }); + const dataController = that.setup({ paginate: true, - store: { - load: function(loadOptions) { - that.loadArgs.push(loadOptions); - return $.Deferred().resolve({ - rows: [ - { value: 'row 1', text: 'row 1', index: 1 }, - { value: 'row 2', text: 'row 2', index: 2 } - ], - columns: [], - values: [[null], [null], [null]], - grandTotalRowIndex: 0, - grandTotalColumnIndex: 0 - }); - }, - getFields: function() { - return $.Deferred().resolve([]); - }, - supportPaging: function() { - return true; - } - }, + store: new CustomPivotStore(), fields: [{ dataField: 'row', area: 'row' }, { area: 'data' }] }); - setTimeout(function() { - assert.strictEqual(that.loadArgs.length, 1, 'one load'); - assert.ok(that.loadArgs[0].rows, 'has rows in load options'); - assert.strictEqual(that.loadArgs[0].rowSkip, 0, 'rowSkip is 0'); - assert.strictEqual(that.loadArgs[0].rowTake, 2, 'rowTake is 2'); + assert.strictEqual(that.loadArgs.length, 1, 'one load'); + assert.ok(that.loadArgs[0].rows, 'has rows in load options'); + assert.strictEqual(that.loadArgs[0].rowSkip, 0, 'rowSkip is 0'); + assert.strictEqual(that.loadArgs[0].rowTake, 2, 'rowTake is 2'); - assert.deepEqual(dataController.getRowsInfo(), [ - [{ dataSourceIndex: 1, text: 'row 1', path: ['row 1'], type: 'D', isLast: true }], - [{ dataSourceIndex: 2, text: 'row 2', path: ['row 2'], type: 'D', isLast: true }] - ]); - done(); - }, 0); + assert.deepEqual(dataController.getRowsInfo(), [ + [{ dataSourceIndex: 1, text: 'row 1', path: ['row 1'], type: 'D', isLast: true }], + [{ dataSourceIndex: 2, text: 'row 2', path: ['row 2'], type: 'D', isLast: true }] + ]); }); });