Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions e2e/testcafe-devextreme/tests/accessibility/scheduler/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,58 @@ test('Scheduler table elements have right aria attributes', async (t) => {
});
});
});

const groupedRooms = [
{ id: 'building-a', text: 'Building A', parentId: null },
{ id: 'floor-a1', text: 'Floor 1', parentId: 'building-a' },
{ id: 101, text: 'Room 101', parentId: 'floor-a1' },
{ id: 102, text: 'Room 102', parentId: 'floor-a1' },
{ id: 'building-b', text: 'Building B', parentId: null },
{ id: 201, text: 'Room 201', parentId: 'building-b' },
];

const flatRooms = groupedRooms.filter(
(room) => !groupedRooms.some((item) => item.parentId === room.id),
);

const groupedAppointments = [
{
text: 'Standup',
roomId: 101,
startDate: new Date('2021-04-29T16:30:00.000Z'),
endDate: new Date('2021-04-29T18:30:00.000Z'),
},
];

const groupingCases = [
{ view: 'day', orientation: 'vertical' },
{ view: 'day', orientation: 'horizontal' },
{ view: 'workWeek', orientation: 'vertical' },
{ view: 'workWeek', orientation: 'horizontal' },
{ view: 'timelineDay', orientation: 'vertical' },
{ view: 'timelineDay', orientation: 'horizontal' },
{ view: 'agenda', orientation: 'vertical' },
];

([
{ name: 'flat', dataSource: flatRooms, parentIdExpr: undefined },
{ name: 'hierarchical', dataSource: groupedRooms, parentIdExpr: 'parentId' },
] as const).forEach(({ name, dataSource, parentIdExpr }) => {
groupingCases.forEach(({ view, orientation }) => {
test(`Scheduler should pass accessibility checks with ${name} grouping on view ${view} (${orientation})`, async (t) => {
await a11yCheck(t, a11yCheckConfig, '#container');
}).before(async () => {
await createWidget('dxScheduler', {
dataSource: groupedAppointments,
views: [{ type: view, groupOrientation: orientation }],
currentView: view,
currentDate: new Date(2021, 3, 29),
startDayHour: 9,
endDayHour: 12,
groups: ['roomId'],
resources: [{ fieldExpr: 'roomId', dataSource, parentIdExpr }],
height: 800,
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ describe('GroupPanelVerticalNode', () => {
expect(children[0].className).toContain('dx-scheduler-group-header-leaf');
});

it('should set title/role/aria-label for the accessible label and overflow tooltip', () => {
it('should set title/aria-label for the accessible label and overflow tooltip', () => {
const component = new GroupPanelVerticalNode({ node: leafNode('a', 'Room A', 1), index: 0 });
const result = component.render() as VirtualNodeLike;
const children = result.children as VirtualNodeLike[];
const cell = children[0];

expect(cell.props?.title).toBe('Room A');
expect(cell.props?.role).toBe('rowheader');
expect(cell.props?.['aria-label']).toBe('Room A');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export class GroupPanelVerticalNode extends BaseInfernoComponent<GroupPanelVerti
<div
className={cellClasses}
title={node.text}
role="rowheader"
aria-label={node.text}
>
{
Expand Down
Loading