Skip to content

Commit 21c86f3

Browse files
authored
DataGrid - AI Column: add integration tests for unsupported filtering properties (#31921)
1 parent bce225f commit 21c86f3

File tree

3 files changed

+542
-0
lines changed

3 files changed

+542
-0
lines changed

packages/devextreme/js/__internal/grids/data_grid/__tests__/__mock__/model/data_grid.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,23 @@ export class DataGridModel extends GridCoreModel<DataGrid> {
1717

1818
return this.getInstance().getVisibleColumns(headerLevel);
1919
}
20+
21+
public setDataGridOptions(options: Record<string, unknown>): void {
22+
const instance = this.getInstance();
23+
24+
Object.entries(options).forEach(([optionName, optionValue]) => {
25+
instance.option(optionName, optionValue);
26+
});
27+
}
28+
29+
public setDataGridColumnOptions(
30+
columnName: string,
31+
options: Record<string, unknown>,
32+
): void {
33+
const instance = this.getInstance();
34+
35+
Object.entries(options).forEach(([optionName, optionValue]) => {
36+
instance.columnOption(columnName, optionName, optionValue);
37+
});
38+
}
2039
}

packages/devextreme/js/__internal/grids/grid_core/__tests__/__mock__/model/grid_core.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const SELECTORS = {
2222
toast: 'dx-toast',
2323
loadPanel: 'dx-loadpanel',
2424
editForm: 'edit-form',
25+
headerCellIndicators: 'dx-column-indicators',
26+
headerCellFilter: 'dx-header-filter',
2527
};
2628

2729
export abstract class GridCoreModel<TInstance extends GridBase = GridBase> {
@@ -48,6 +50,13 @@ export abstract class GridCoreModel<TInstance extends GridBase = GridBase> {
4850
);
4951
}
5052

53+
public getHeaderCellFilter(columnIndex: number): dxElementWrapper {
54+
const $headerCell = $(this.getHeaderCells()[columnIndex]);
55+
const headerFilterSelector = `.${SELECTORS.headerCellIndicators} > .${SELECTORS.headerCellFilter}`;
56+
57+
return $headerCell.find(headerFilterSelector);
58+
}
59+
5160
public getDataRows(): NodeListOf<HTMLElement> {
5261
return this.root.querySelectorAll(`.${SELECTORS.dataRowClass}`);
5362
}

0 commit comments

Comments
 (0)