@zeedhi/teknisa-components-common 1.107.1 → 1.108.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +7 -7
- package/coverage/clover.xml +772 -692
- package/coverage/coverage-final.json +47 -47
- package/coverage/lcov-report/index.html +15 -15
- package/coverage/lcov-report/tests/__helpers__/component-event-helper.ts.html +2 -2
- package/coverage/lcov-report/tests/__helpers__/flush-promises-helper.ts.html +2 -2
- package/coverage/lcov-report/tests/__helpers__/get-child-helper.ts.html +7 -7
- package/coverage/lcov-report/tests/__helpers__/index.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/index.ts.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/mock-created-helper.ts.html +1 -1
- package/coverage/lcov.info +1459 -1275
- package/dist/tek-components-common.esm.js +375 -252
- package/dist/tek-components-common.umd.js +375 -252
- package/jest.config.js +1 -1
- package/package.json +2 -2
- package/tests/__helpers__/component-event-helper.ts +5 -5
- package/tests/__helpers__/flush-promises-helper.ts +3 -3
- package/tests/__helpers__/get-child-helper.ts +27 -27
- package/tests/__helpers__/index.ts +3 -3
- package/tests/__helpers__/mock-created-helper.ts +12 -12
- package/tests/__mocks__/@zeedhi/core/i18n.js +74 -74
- package/tests/__mocks__/@zeedhi/core.js +4 -4
- package/tests/unit/components/crud/crud-add-button.spec.ts +56 -56
- package/tests/unit/components/crud/crud-button.spec.ts +94 -94
- package/tests/unit/components/crud/crud-cancel-button.spec.ts +91 -91
- package/tests/unit/components/crud/crud-delete-button.spec.ts +122 -122
- package/tests/unit/components/crud/crud-form.spec.ts +165 -165
- package/tests/unit/components/crud/crud-save-button.spec.ts +118 -118
- package/tests/unit/components/tek-breadcrumb-header/tek-breadcrumb-header.spec.ts +42 -42
- package/tests/unit/components/tek-card-title/CardTitle.spec.ts +34 -34
- package/tests/unit/components/tek-datasource/memory-datasource.spec.ts +470 -470
- package/tests/unit/components/tek-datasource/rest-datasource.spec.ts +364 -364
- package/tests/unit/components/tek-drag-grid/tek-drag-grid.spec.ts +112 -112
- package/tests/unit/components/tek-grid/filter-helper.spec.ts +148 -148
- package/tests/unit/components/tek-grid/grid-column.spec.ts +270 -270
- package/tests/unit/components/tek-grid/grid-columns-button.spec.ts +195 -195
- package/tests/unit/components/tek-grid/grid-filter-button.spec.ts +967 -967
- package/tests/unit/components/tek-grid/grid.spec.ts +3340 -3116
- package/tests/unit/components/tek-grid/layout_options.spec.ts +980 -980
- package/tests/unit/components/tek-image/Image.spec.ts +67 -67
- package/tests/unit/components/tek-iterable-carousel/iterable-carousel.spec.ts +37 -37
- package/tests/unit/components/tek-iterable-component-render/iterable-component-render.spec.ts +200 -200
- package/tests/unit/components/tek-loading/Loading.spec.ts +30 -30
- package/tests/unit/components/tek-notifications/notifications.spec.ts +201 -201
- package/tests/unit/components/tek-product-card/product-card.spec.ts +61 -61
- package/tests/unit/components/tek-user-info/TekUserInfoContoller.spec.ts +220 -220
- package/tests/unit/components/tek-user-info/tek-user-info-list.spec.ts +86 -86
- package/tests/unit/components/tek-user-info/tek-user-info.spec.ts +430 -430
- package/tests/unit/components/tree-grid/tree-grid.spec.ts +776 -776
- package/tests/unit/utils/grid-base/delete-rows-error.spec.ts +24 -0
- package/tests/unit/utils/grid-base/export-options/button-option.spec.ts +44 -44
- package/tests/unit/utils/grid-base/export-options/multi-option.spec.ts +135 -135
- package/tests/unit/utils/grid-base/grid-controller.spec.ts +267 -174
- package/tests/unit/utils/report-filter/report-filter.spec.ts +66 -66
- package/tsconfig.eslint.json +8 -8
- package/types/components/tek-datasource/memory-datasource.d.ts +2 -4
- package/types/components/tek-datasource/rest-datasource.d.ts +6 -3
- package/types/components/tek-grid/grid.d.ts +50 -6
- package/types/components/tek-grid/interfaces.d.ts +5 -3
- package/types/components/tek-tree-grid/tree-grid.d.ts +5 -1
- package/types/utils/grid-base/grid-base.d.ts +12 -229
- package/types/utils/grid-base/grid-controller.d.ts +1 -3
- package/types/components/tek-ag-grid/default-icons.d.ts +0 -53
- package/types/components/tek-ag-grid/interfaces.d.ts +0 -9
- package/types/components/tek-ag-grid/tek-ag-grid.d.ts +0 -35
- package/types/components/tek-datasource/datasource.d.ts +0 -94
- package/types/components/tek-grid/default-icons.d.ts +0 -53
- package/types/components/tek-grid/filter-dynamic-values.d.ts +0 -9
- package/types/components/tek-grid/grid-controller.d.ts +0 -19
- package/types/components/tek-grid/grid_column.d.ts +0 -14
- package/types/components/tek-grid/grid_controller.d.ts +0 -15
- package/types/components/tek-grid/tek-grid.d.ts +0 -35
- package/types/components/tek-login/interfaces.d.ts +0 -3
- package/types/components/tek-login/login-children.d.ts +0 -3
- package/types/components/tek-login/login.d.ts +0 -58
- package/types/components/tek-login/login_children.d.ts +0 -3
|
@@ -1,195 +1,195 @@
|
|
|
1
|
-
import { Checkbox, Iterable } from '@zeedhi/common';
|
|
2
|
-
import { I18n } from '@zeedhi/core';
|
|
3
|
-
import { TekGrid, TekGridColumnsButton } from '../../../../src';
|
|
4
|
-
import { TekGridColumnsButtonController } from '../../../../src/components/tek-grid/grid-columns-button-controller';
|
|
5
|
-
|
|
6
|
-
describe('TekGridColumnsButton', () => {
|
|
7
|
-
describe('getAggregationSelectData', () => {
|
|
8
|
-
it('should get aggregation data', () => {
|
|
9
|
-
let I18Called = false;
|
|
10
|
-
const spy = jest.spyOn(I18n, 'translate').mockImplementation((code: string | string[]) => {
|
|
11
|
-
I18Called = true;
|
|
12
|
-
if (Array.isArray(code)) return code[0];
|
|
13
|
-
return code;
|
|
14
|
-
});
|
|
15
|
-
const grid = new TekGrid({
|
|
16
|
-
name: 'grid-1',
|
|
17
|
-
component: 'TekGrid',
|
|
18
|
-
});
|
|
19
|
-
const instance = new TekGridColumnsButton({
|
|
20
|
-
name: 'columns-button-1',
|
|
21
|
-
component: 'TekGridColumnsButton',
|
|
22
|
-
parent: grid,
|
|
23
|
-
});
|
|
24
|
-
instance.onCreated();
|
|
25
|
-
let data = instance.getAggregationSelectData();
|
|
26
|
-
expect(data).toEqual([
|
|
27
|
-
{ text: 'TEKGRID_AGGREGATION_SUM', value: 'SUM' },
|
|
28
|
-
{ text: 'TEKGRID_AGGREGATION_MIN', value: 'MIN' },
|
|
29
|
-
{ text: 'TEKGRID_AGGREGATION_MAX', value: 'MAX' },
|
|
30
|
-
{ text: 'TEKGRID_AGGREGATION_AVG', value: 'AVG' },
|
|
31
|
-
{ text: 'TEKGRID_AGGREGATION_COUNT', value: 'COUNT' },
|
|
32
|
-
]);
|
|
33
|
-
expect(I18Called).toBeTruthy();
|
|
34
|
-
I18Called = false;
|
|
35
|
-
data = instance.getAggregationSelectData();
|
|
36
|
-
expect(I18Called).toBeFalsy();
|
|
37
|
-
spy.mockClear();
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
describe('controller', () => {
|
|
42
|
-
it('should create component controller', () => {
|
|
43
|
-
const checkbox = new Checkbox({
|
|
44
|
-
name: 'checkbox',
|
|
45
|
-
component: 'ZdCheckbox',
|
|
46
|
-
value: false,
|
|
47
|
-
});
|
|
48
|
-
const iterable = new Iterable({
|
|
49
|
-
name: 'iterable',
|
|
50
|
-
component: 'ZdIterable',
|
|
51
|
-
columns: [
|
|
52
|
-
{
|
|
53
|
-
name: 'id',
|
|
54
|
-
grouped: false,
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
});
|
|
58
|
-
const grid = new TekGrid({
|
|
59
|
-
name: 'grid-1',
|
|
60
|
-
component: 'TekGrid',
|
|
61
|
-
parent: iterable,
|
|
62
|
-
});
|
|
63
|
-
const instance = new TekGridColumnsButton({
|
|
64
|
-
name: 'columns-button-2',
|
|
65
|
-
component: 'TekGridColumnsButton',
|
|
66
|
-
parent: grid,
|
|
67
|
-
});
|
|
68
|
-
instance.onCreated();
|
|
69
|
-
expect(instance.controller).toBeInstanceOf(TekGridColumnsButtonController);
|
|
70
|
-
expect(iterable.columns[0].isVisible).toBeTruthy();
|
|
71
|
-
instance.controller.showHideTekColumn(iterable.columns[0], { component: checkbox });
|
|
72
|
-
expect(iterable.columns[0].isVisible).toBeFalsy();
|
|
73
|
-
|
|
74
|
-
(iterable.columns[0] as any).grouped = true;
|
|
75
|
-
iterable.columns[0].isVisible = false;
|
|
76
|
-
instance.controller.showHideTekColumn(iterable.columns[0], { component: checkbox });
|
|
77
|
-
expect(iterable.columns[0].isVisible).toBeFalsy();
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('changeGroupedColumn', () => {
|
|
81
|
-
const grid = new TekGrid({
|
|
82
|
-
name: 'grid-2',
|
|
83
|
-
component: 'TekGrid',
|
|
84
|
-
columns: [
|
|
85
|
-
{
|
|
86
|
-
name: 'id',
|
|
87
|
-
label: 'id',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: 'name',
|
|
91
|
-
label: 'name',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'department',
|
|
95
|
-
label: 'department',
|
|
96
|
-
grouped: true,
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
datasource: {
|
|
100
|
-
uniqueKey: 'id',
|
|
101
|
-
order: ['name.asc'],
|
|
102
|
-
data: [
|
|
103
|
-
{ id: 2, name: 'employee 2', department: 1 },
|
|
104
|
-
{ id: 5, name: 'employee 5', department: 2 },
|
|
105
|
-
{ id: 4, name: 'employee 4', department: 2 },
|
|
106
|
-
{ id: 3, name: 'employee 3', department: 1 },
|
|
107
|
-
{ id: 1, name: 'employee 1', department: 1 },
|
|
108
|
-
],
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
const instance = new TekGridColumnsButton({
|
|
112
|
-
name: 'columns-button-3',
|
|
113
|
-
component: 'TekGridColumnsButton',
|
|
114
|
-
parent: grid,
|
|
115
|
-
});
|
|
116
|
-
instance.onCreated();
|
|
117
|
-
expect(grid.columns[0].grouped).toBeFalsy();
|
|
118
|
-
instance.controller.changeGroupedColumn(grid.columns[0], {
|
|
119
|
-
component: {
|
|
120
|
-
value: true,
|
|
121
|
-
},
|
|
122
|
-
});
|
|
123
|
-
expect(grid.columns[0].grouped).toBeTruthy();
|
|
124
|
-
instance.controller.changeGroupedColumn(grid.columns[0], {
|
|
125
|
-
component: {
|
|
126
|
-
value: false,
|
|
127
|
-
},
|
|
128
|
-
});
|
|
129
|
-
expect(grid.columns[0].grouped).toBeFalsy();
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it('changeAggregationColumn', () => {
|
|
133
|
-
const grid = new TekGrid({
|
|
134
|
-
name: 'grid-2',
|
|
135
|
-
component: 'TekGrid',
|
|
136
|
-
columns: [
|
|
137
|
-
{
|
|
138
|
-
name: 'id',
|
|
139
|
-
label: 'id',
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
name: 'name',
|
|
143
|
-
label: 'name',
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: 'department',
|
|
147
|
-
label: 'department',
|
|
148
|
-
grouped: true,
|
|
149
|
-
},
|
|
150
|
-
],
|
|
151
|
-
datasource: {
|
|
152
|
-
uniqueKey: 'id',
|
|
153
|
-
order: ['name.asc'],
|
|
154
|
-
data: [
|
|
155
|
-
{ id: 2, name: 'employee 2', department: 1 },
|
|
156
|
-
{ id: 5, name: 'employee 5', department: 2 },
|
|
157
|
-
{ id: 4, name: 'employee 4', department: 2 },
|
|
158
|
-
{ id: 3, name: 'employee 3', department: 1 },
|
|
159
|
-
{ id: 1, name: 'employee 1', department: 1 },
|
|
160
|
-
],
|
|
161
|
-
},
|
|
162
|
-
});
|
|
163
|
-
const spy = jest.spyOn(grid, 'changeLayout');
|
|
164
|
-
const instance = new TekGridColumnsButton({
|
|
165
|
-
name: 'columns-button-4',
|
|
166
|
-
component: 'TekGridColumnsButton',
|
|
167
|
-
parent: grid,
|
|
168
|
-
});
|
|
169
|
-
instance.onCreated();
|
|
170
|
-
expect(grid.columns[0].aggregation).toBeUndefined();
|
|
171
|
-
expect(spy).toBeCalledTimes(0);
|
|
172
|
-
instance.controller.changeAggregationColumn(grid.columns[0], {
|
|
173
|
-
component: {
|
|
174
|
-
value: 'COUNT',
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
expect(spy).toBeCalledTimes(1);
|
|
178
|
-
instance.controller.changeAggregationColumn(grid.columns[0], {
|
|
179
|
-
component: {
|
|
180
|
-
value: 'COUNT',
|
|
181
|
-
},
|
|
182
|
-
});
|
|
183
|
-
expect(spy).toBeCalledTimes(1);
|
|
184
|
-
expect(grid.columns[0].aggregation).toBe('COUNT');
|
|
185
|
-
instance.controller.changeAggregationColumn(grid.columns[0], {
|
|
186
|
-
component: {
|
|
187
|
-
value: null,
|
|
188
|
-
},
|
|
189
|
-
});
|
|
190
|
-
expect(grid.columns[0].aggregation).toBeUndefined();
|
|
191
|
-
expect(spy).toBeCalledTimes(2);
|
|
192
|
-
spy.mockClear();
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
});
|
|
1
|
+
import { Checkbox, Iterable } from '@zeedhi/common';
|
|
2
|
+
import { I18n } from '@zeedhi/core';
|
|
3
|
+
import { TekGrid, TekGridColumnsButton } from '../../../../src';
|
|
4
|
+
import { TekGridColumnsButtonController } from '../../../../src/components/tek-grid/grid-columns-button-controller';
|
|
5
|
+
|
|
6
|
+
describe('TekGridColumnsButton', () => {
|
|
7
|
+
describe('getAggregationSelectData', () => {
|
|
8
|
+
it('should get aggregation data', () => {
|
|
9
|
+
let I18Called = false;
|
|
10
|
+
const spy = jest.spyOn(I18n, 'translate').mockImplementation((code: string | string[]) => {
|
|
11
|
+
I18Called = true;
|
|
12
|
+
if (Array.isArray(code)) return code[0];
|
|
13
|
+
return code;
|
|
14
|
+
});
|
|
15
|
+
const grid = new TekGrid({
|
|
16
|
+
name: 'grid-1',
|
|
17
|
+
component: 'TekGrid',
|
|
18
|
+
});
|
|
19
|
+
const instance = new TekGridColumnsButton({
|
|
20
|
+
name: 'columns-button-1',
|
|
21
|
+
component: 'TekGridColumnsButton',
|
|
22
|
+
parent: grid,
|
|
23
|
+
});
|
|
24
|
+
instance.onCreated();
|
|
25
|
+
let data = instance.getAggregationSelectData();
|
|
26
|
+
expect(data).toEqual([
|
|
27
|
+
{ text: 'TEKGRID_AGGREGATION_SUM', value: 'SUM' },
|
|
28
|
+
{ text: 'TEKGRID_AGGREGATION_MIN', value: 'MIN' },
|
|
29
|
+
{ text: 'TEKGRID_AGGREGATION_MAX', value: 'MAX' },
|
|
30
|
+
{ text: 'TEKGRID_AGGREGATION_AVG', value: 'AVG' },
|
|
31
|
+
{ text: 'TEKGRID_AGGREGATION_COUNT', value: 'COUNT' },
|
|
32
|
+
]);
|
|
33
|
+
expect(I18Called).toBeTruthy();
|
|
34
|
+
I18Called = false;
|
|
35
|
+
data = instance.getAggregationSelectData();
|
|
36
|
+
expect(I18Called).toBeFalsy();
|
|
37
|
+
spy.mockClear();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('controller', () => {
|
|
42
|
+
it('should create component controller', () => {
|
|
43
|
+
const checkbox = new Checkbox({
|
|
44
|
+
name: 'checkbox',
|
|
45
|
+
component: 'ZdCheckbox',
|
|
46
|
+
value: false,
|
|
47
|
+
});
|
|
48
|
+
const iterable = new Iterable({
|
|
49
|
+
name: 'iterable',
|
|
50
|
+
component: 'ZdIterable',
|
|
51
|
+
columns: [
|
|
52
|
+
{
|
|
53
|
+
name: 'id',
|
|
54
|
+
grouped: false,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
});
|
|
58
|
+
const grid = new TekGrid({
|
|
59
|
+
name: 'grid-1',
|
|
60
|
+
component: 'TekGrid',
|
|
61
|
+
parent: iterable,
|
|
62
|
+
});
|
|
63
|
+
const instance = new TekGridColumnsButton({
|
|
64
|
+
name: 'columns-button-2',
|
|
65
|
+
component: 'TekGridColumnsButton',
|
|
66
|
+
parent: grid,
|
|
67
|
+
});
|
|
68
|
+
instance.onCreated();
|
|
69
|
+
expect(instance.controller).toBeInstanceOf(TekGridColumnsButtonController);
|
|
70
|
+
expect(iterable.columns[0].isVisible).toBeTruthy();
|
|
71
|
+
instance.controller.showHideTekColumn(iterable.columns[0], { component: checkbox });
|
|
72
|
+
expect(iterable.columns[0].isVisible).toBeFalsy();
|
|
73
|
+
|
|
74
|
+
(iterable.columns[0] as any).grouped = true;
|
|
75
|
+
iterable.columns[0].isVisible = false;
|
|
76
|
+
instance.controller.showHideTekColumn(iterable.columns[0], { component: checkbox });
|
|
77
|
+
expect(iterable.columns[0].isVisible).toBeFalsy();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('changeGroupedColumn', () => {
|
|
81
|
+
const grid = new TekGrid({
|
|
82
|
+
name: 'grid-2',
|
|
83
|
+
component: 'TekGrid',
|
|
84
|
+
columns: [
|
|
85
|
+
{
|
|
86
|
+
name: 'id',
|
|
87
|
+
label: 'id',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'name',
|
|
91
|
+
label: 'name',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'department',
|
|
95
|
+
label: 'department',
|
|
96
|
+
grouped: true,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
datasource: {
|
|
100
|
+
uniqueKey: 'id',
|
|
101
|
+
order: ['name.asc'],
|
|
102
|
+
data: [
|
|
103
|
+
{ id: 2, name: 'employee 2', department: 1 },
|
|
104
|
+
{ id: 5, name: 'employee 5', department: 2 },
|
|
105
|
+
{ id: 4, name: 'employee 4', department: 2 },
|
|
106
|
+
{ id: 3, name: 'employee 3', department: 1 },
|
|
107
|
+
{ id: 1, name: 'employee 1', department: 1 },
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
const instance = new TekGridColumnsButton({
|
|
112
|
+
name: 'columns-button-3',
|
|
113
|
+
component: 'TekGridColumnsButton',
|
|
114
|
+
parent: grid,
|
|
115
|
+
});
|
|
116
|
+
instance.onCreated();
|
|
117
|
+
expect(grid.columns[0].grouped).toBeFalsy();
|
|
118
|
+
instance.controller.changeGroupedColumn(grid.columns[0], {
|
|
119
|
+
component: {
|
|
120
|
+
value: true,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
expect(grid.columns[0].grouped).toBeTruthy();
|
|
124
|
+
instance.controller.changeGroupedColumn(grid.columns[0], {
|
|
125
|
+
component: {
|
|
126
|
+
value: false,
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
expect(grid.columns[0].grouped).toBeFalsy();
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('changeAggregationColumn', () => {
|
|
133
|
+
const grid = new TekGrid({
|
|
134
|
+
name: 'grid-2',
|
|
135
|
+
component: 'TekGrid',
|
|
136
|
+
columns: [
|
|
137
|
+
{
|
|
138
|
+
name: 'id',
|
|
139
|
+
label: 'id',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'name',
|
|
143
|
+
label: 'name',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'department',
|
|
147
|
+
label: 'department',
|
|
148
|
+
grouped: true,
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
datasource: {
|
|
152
|
+
uniqueKey: 'id',
|
|
153
|
+
order: ['name.asc'],
|
|
154
|
+
data: [
|
|
155
|
+
{ id: 2, name: 'employee 2', department: 1 },
|
|
156
|
+
{ id: 5, name: 'employee 5', department: 2 },
|
|
157
|
+
{ id: 4, name: 'employee 4', department: 2 },
|
|
158
|
+
{ id: 3, name: 'employee 3', department: 1 },
|
|
159
|
+
{ id: 1, name: 'employee 1', department: 1 },
|
|
160
|
+
],
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
const spy = jest.spyOn(grid, 'changeLayout');
|
|
164
|
+
const instance = new TekGridColumnsButton({
|
|
165
|
+
name: 'columns-button-4',
|
|
166
|
+
component: 'TekGridColumnsButton',
|
|
167
|
+
parent: grid,
|
|
168
|
+
});
|
|
169
|
+
instance.onCreated();
|
|
170
|
+
expect(grid.columns[0].aggregation).toBeUndefined();
|
|
171
|
+
expect(spy).toBeCalledTimes(0);
|
|
172
|
+
instance.controller.changeAggregationColumn(grid.columns[0], {
|
|
173
|
+
component: {
|
|
174
|
+
value: 'COUNT',
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
expect(spy).toBeCalledTimes(1);
|
|
178
|
+
instance.controller.changeAggregationColumn(grid.columns[0], {
|
|
179
|
+
component: {
|
|
180
|
+
value: 'COUNT',
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
expect(spy).toBeCalledTimes(1);
|
|
184
|
+
expect(grid.columns[0].aggregation).toBe('COUNT');
|
|
185
|
+
instance.controller.changeAggregationColumn(grid.columns[0], {
|
|
186
|
+
component: {
|
|
187
|
+
value: null,
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
expect(grid.columns[0].aggregation).toBeUndefined();
|
|
191
|
+
expect(spy).toBeCalledTimes(2);
|
|
192
|
+
spy.mockClear();
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
});
|