-
Notifications
You must be signed in to change notification settings - Fork 674
Expand file tree
/
Copy pathpivotGrid.ts
More file actions
106 lines (93 loc) · 2.59 KB
/
Copy pathpivotGrid.ts
File metadata and controls
106 lines (93 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import PivotGrid from 'devextreme-testcafe-models/pivotGrid';
import { Selector } from 'testcafe';
import url from '../../helpers/getPageUrl';
import { createWidget } from '../../helpers/createWidget';
import { a11yCheck } from '../../helpers/accessibility/utils';
fixture.disablePageReloads`PivotGrid - Accessibility`
.page(url(__dirname, '../container.html'));
const PIVOT_GRID_SELECTOR = '#container';
const createConfig = () => ({
width: 1000,
allowSorting: true,
allowSortingBySummary: true,
allowFiltering: true,
allowExpandAll: true,
showBorders: true,
fieldPanel: {
visible: true,
},
fieldChooser: {
enabled: true,
height: 500,
},
dataSource: {
fields: [{
dataField: 'country',
area: 'filter',
}, {
caption: 'Region',
width: 120,
dataField: 'region',
area: 'row',
}, {
caption: 'City',
dataField: 'city',
width: 150,
area: 'row',
}, {
caption: 'Country',
dataField: 'country',
area: 'column',
}, {
dataField: 'date',
dataType: 'date',
area: 'column',
}, {
groupName: 'date',
groupInterval: 'year',
expanded: true,
area: 'column',
}, {
caption: 'Sales',
dataField: 'amount',
dataType: 'number',
summaryType: 'sum',
area: 'data',
}],
store: [{
region: 'Africa',
country: 'Egypt',
city: 'Cairo',
amount: 500,
date: new Date('2015-05-26'),
}, {
region: 'South America',
country: 'Argentina',
city: 'Buenos Aires',
amount: 780,
date: new Date('2015-05-07'),
}],
},
});
test('grid with field panel', async (t) => {
await a11yCheck(t, {}, PIVOT_GRID_SELECTOR);
}).before(async () => createWidget('dxPivotGrid', createConfig()));
test('field chooser popup', async (t) => {
const pivotGrid = new PivotGrid(PIVOT_GRID_SELECTOR);
await t.click(pivotGrid.getFieldChooserButton());
await a11yCheck(t);
}).before(async () => createWidget('dxPivotGrid', createConfig()));
test('header filter popup', async (t) => {
const pivotGrid = new PivotGrid(PIVOT_GRID_SELECTOR);
const filterIcon = pivotGrid
.getColumnHeaderArea()
.getHeaderFilterIcon()
.element;
await t.click(filterIcon);
await a11yCheck(t);
}).before(async () => createWidget('dxPivotGrid', createConfig()));
test('cell context menu', async (t) => {
const columnHeaderCell = Selector('.dx-pivotgrid-horizontal-headers td[tabindex]');
await t.rightClick(columnHeaderCell);
await a11yCheck(t);
}).before(async () => createWidget('dxPivotGrid', createConfig()));