Skip to content

Commit

Permalink
DataGrid - The "aria-label" attribute value is "Show filter options f… (
Browse files Browse the repository at this point in the history
  • Loading branch information
Raushen authored Jan 15, 2024
1 parent 704a22f commit d56f89f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ const HeaderPanelHeaderFilterExtender = extend({}, headerFilterMixin, {
alignment: getDefaultAlignment(that.option('rtlEnabled')),
filterValues: groupColumn.filterValues,
allowHeaderFiltering: true,
caption: groupColumn.caption,
},
showColumnLines: true,
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { GroupPanelItem } from './groupPanelItem';

const ITEM_SELECTOR = '.dx-group-panel-item';

export class GroupPanel {
constructor(private readonly selector: Selector) {}

getHeader(i: number): Selector {
return this.selector.find(ITEM_SELECTOR).nth(i);
getHeader(i: number): GroupPanelItem {
return new GroupPanelItem(this.selector.find(ITEM_SELECTOR).nth(i));
}

getHeadersCount(): Promise<number> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const CLASS = {
filterButton: 'dx-header-filter',
};

export class GroupPanelItem {
element: Selector;

constructor(selector: Selector) {
this.element = selector;
}

getFilterButton(): Selector {
return this.element.find(`.${CLASS.filterButton}`);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,30 @@ test('T1187314 - DataGrid displays an incorrect row count in "aria-label" if the
filterValue: ['id', '=', '1'],
scrolling: { mode: 'infinite' },
}));

test('DataGrid - The \'aria-label\' attribute value is "Show filter options for column \'undefined\' for the header filter icon in grouped fields (T1205784)', async (t) => {
const dataGrid = new DataGrid('#container');

await t
.expect(dataGrid.getGroupPanel().getHeader(0).getFilterButton().getAttribute('aria-label'))
.eql('Show filter options for column \'Id\'');
}).before(async () => createWidget('dxDataGrid', {
keyExpr: 'id',
dataSource: [{
id: 0,
data: 'A',
}],
groupPanel: {
visible: true,
},
headerFilter: {
visible: true,
},
columns: [
'data',
{
dataField: 'id',
groupIndex: 0,
},
],
}));
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ test('column separator should work properly with expand columns', async (t) => {
const dataGrid = new DataGrid('#container');
await MouseUpEvents.disable(MouseAction.dragToOffset);

await t.drag(dataGrid.getGroupPanel().getHeader(0), 0, 30);
await t.drag(dataGrid.getGroupPanel().getHeader(0).element, 0, 30);
await t
.expect(await takeScreenshot('column-separator-with-expand-columns.png'))
.ok()
Expand Down Expand Up @@ -180,7 +180,7 @@ test.skip('HeaderRow should be highlighted when dragging column with allowColumn
const dataGrid = new DataGrid('#container');
await MouseUpEvents.disable(MouseAction.dragToOffset);

await t.drag(dataGrid.getGroupPanel().getHeader(0), 0, 30);
await t.drag(dataGrid.getGroupPanel().getHeader(0).element, 0, 30);
await t
.expect(await takeScreenshot('headerRow-highlight-on-drag.png'))
.ok()
Expand Down Expand Up @@ -224,7 +224,7 @@ test('Column without allowReordering should have same position after dragging to
await t.drag(dataGrid.getHeaders().getHeaderRow(0).getHeaderCell(2).element, -30, -30);
await t.expect(dataGrid.getGroupPanel().getHeadersCount()).eql(1);

await t.drag(dataGrid.getGroupPanel().getHeader(0), 0, 30);
await t.drag(dataGrid.getGroupPanel().getHeader(0).element, 0, 30);

const headers = await Promise.all([0, 1, 2, 3].map(
(i) => dataGrid.getHeaders().getHeaderRow(0).getHeaderCell(i).element.textContent,
Expand Down

0 comments on commit d56f89f

Please sign in to comment.