Skip to content

Commit 80c54ac

Browse files
Enhance Hamburger module tests with fieldChooserBase mock for improved rendering
1 parent 78bad05 commit 80c54ac

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/fieldsArea.tests.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,25 @@ QUnit.module('Rendering', {
178178

179179
QUnit.module('Hamburger', {
180180
beforeEach: function() {
181+
const fieldChooserBaseMock = {
182+
renderField: function(field) {
183+
return $('<div>').addClass('dx-area-field').text(field.dataField);
184+
},
185+
subscribeToEvents: sinon.stub(),
186+
renderSortable: sinon.stub()
187+
};
188+
181189
this.component = {
182190
option: sinon.stub(),
183191
$element: function() {
184-
return $('<div>').dxPivotGridFieldChooserBase();
192+
const element = $('<div>');
193+
element.dxPivotGridFieldChooserBase = function(method) {
194+
if(method === 'instance') {
195+
return fieldChooserBaseMock;
196+
}
197+
return element;
198+
};
199+
return element;
185200
},
186201

187202
_createComponent: function(container, Component, options) {

0 commit comments

Comments
 (0)