Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
pomahtri committed Aug 25, 2024
1 parent fdddc00 commit ff846e5
Showing 1 changed file with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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, () => {
Expand Down Expand Up @@ -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' }],
Expand Down

0 comments on commit ff846e5

Please sign in to comment.