diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/store.xmla.common.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/store.xmla.common.tests.js index dc9a6dc81baf..e77825e8e530 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/store.xmla.common.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/store.xmla.common.tests.js @@ -321,7 +321,28 @@ QUnit.module('Misc', stubsEnvironment, () => { assert.deepEqual(filterExpr, ['(SELECT {[Product].[Category].[Product].[Category]&}on 0']); }); + QUnit.test('T1236954. Build a correct filter query when a member has unknown member', function(assert) { + this.store.load({ + values: [{ + dataField: '[Measures].[Calculated Cost]', + }], + columns: [{ + dataField: '[Activities - Activities].[Activities]', + filterValues: ['[Activities - Activities].[Activities].[All].UNKNOWNMEMBER', + '[Activities - Activities].[Activities].&[24]', + '[Activities - Activities].[Activities].&[21]'], + }], + rows: [{ + dataField: '[Departments - Activities].[Departments]', + }], + }); + const filterExpr = this.getQuery().match(/\(select(.+?)on 0/gi); + + assert.deepEqual(filterExpr, [ + '(SELECT {[Activities - Activities].[Activities].[All].UNKNOWNMEMBER,[Activities - Activities].[Activities].&[24],[Activities - Activities].[Activities].&[21]}on 0', + ]); + }); }); QUnit.module('getDrillDownItems', stubsEnvironment, () => { @@ -391,6 +412,25 @@ QUnit.module('getDrillDownItems', stubsEnvironment, () => { assert.strictEqual(this.getQuery(2), 'drillthrough SELECT [Measures].[Customer Count] on 0 FROM [Adventure Works] CELL PROPERTIES VALUE, FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS'); }); + QUnit.test('getDrillDownItems with several value fields', function(assert) { + const loadOptions = { + columns: [{ dataField: '[Product].[Category]', filterType: 'include' }], + rows: [{ dataField: '[Ship Date].[Calendar Year]', filterType: 'include' }], + values: [{ + dataField: '[Measures].[Customer Count]', + caption: 'Count' + }, { dataField: '[Measures].[Internet Sales Order]', caption: 'Sales Order' }] + }; + + this.store.getDrillDownItems(loadOptions, { columnPath: [], rowPath: [], dataIndex: 0 }); + this.store.getDrillDownItems(loadOptions, { columnPath: [], rowPath: [], dataIndex: 1 }); + this.store.getDrillDownItems(loadOptions, { columnPath: [], rowPath: [], dataIndex: 2 }); + + assert.strictEqual(this.getQuery(0), 'drillthrough SELECT [Measures].[Customer Count] on 0 FROM [Adventure Works] CELL PROPERTIES VALUE, FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS'); + assert.strictEqual(this.getQuery(1), 'drillthrough SELECT [Measures].[Internet Sales Order] on 0 FROM [Adventure Works] CELL PROPERTIES VALUE, FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS'); + assert.strictEqual(this.getQuery(2), 'drillthrough SELECT [Measures].[Customer Count] on 0 FROM [Adventure Works] CELL PROPERTIES VALUE, FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS'); + }); + QUnit.test('getDrillDownItems with paths without rows', function(assert) { const loadOptions = { columns: [{ dataField: '[Product].[Category]', filterType: 'include' }],