-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy pathaggregates.spec.ts
53 lines (51 loc) · 2.19 KB
/
aggregates.spec.ts
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
import { TreeGrid } from '../../src/treegrid/base/treegrid';
import { sampleData } from './datasource.spec';
import { Aggregate } from '@syncfusion/ej2-grids';
import { createGrid, destroy } from './treegridutil.spec';
TreeGrid.Inject(Aggregate);
describe('The Column template with child Aggreagate is not working properly- EJ2-63995 ', () => {
let gridObj: TreeGrid;
let rows: Element[];
beforeAll((done: Function) => {
gridObj = createGrid(
{
dataSource: sampleData,
childMapping: 'subtasks',
treeColumnIndex: 0,
rowHeight: 83,
columns: [
{ field: 'taskID', headerText: 'Task ID', width: 90, textAlign: 'Right' },
{ field: 'taskName', headerText: 'Task Name', width: 180, textAlign: 'Left' },
{ field: 'duration', headerText: 'Duration', width: 80, textAlign: 'Right' },
{ field: 'progress', headerText: 'Progress', width: 80, textAlign: 'Right' },
{ headerText: 'Tax per annum', textAlign: 'Center', template: '<span>test</span>', width: 90 }
],
width: 'auto',
height: 359,
aggregates: [
{
showChildSummary: true,
columns: [
{
type: 'Max',
field: 'progress',
columnName: 'progress',
footerTemplate: 'Maximum: ${Max}'
}
]
}
]
},
done
);
});
it('Check the Column template with child Aggreagate working properly', () => {
rows = gridObj.getRows();
expect((rows[5] as HTMLTableRowElement).cells[4].classList.contains('e-templatecell')).toBe(true);
expect((rows[5] as HTMLTableRowElement).cells[4].classList.contains('e-summarycell')).toBe(true);
expect((rows[5] as HTMLTableRowElement).cells[4].innerHTML).toBe('');
});
afterAll(() => {
destroy(gridObj);
});
});