@@ -17,7 +17,6 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
17
17
18
18
@Directive ( )
19
19
class PoTableComponent extends PoTableBaseComponent {
20
- calculateWidthHeaders ( ) { }
21
20
checkInfiniteScroll ( ) { }
22
21
calculateHeightTableContainer ( height ) { }
23
22
}
@@ -106,22 +105,18 @@ describe('PoTableBaseComponent:', () => {
106
105
expectPropertiesValues ( component , 'items' , [ ] , [ ] ) ;
107
106
} ) ;
108
107
109
- it ( 'should set selectable and call calculateWidthHeaders' , ( ) => {
110
- spyOn ( component , 'calculateWidthHeaders' ) ;
108
+ it ( 'should set selectable' , ( ) => {
111
109
const validValues = [ '' , true , 1 ] ;
112
110
const invalidValues = [ undefined , null , false , 0 ] ;
113
111
114
112
expectPropertiesValues ( component , 'selectable' , validValues , true ) ;
115
113
expectPropertiesValues ( component , 'selectable' , invalidValues , false ) ;
116
- expect ( component . calculateWidthHeaders ) . toHaveBeenCalled ( ) ;
117
114
} ) ;
118
115
119
- it ( 'should set hideDetail and call calculateWidthHeaders' , ( ) => {
120
- spyOn ( component , 'calculateWidthHeaders' ) ;
116
+ it ( 'should set hideDetail' , ( ) => {
121
117
expectSettersMethod ( component , 'hideDetail' , '' , 'hideDetail' , true ) ;
122
118
expectSettersMethod ( component , 'hideDetail' , 'true' , 'hideDetail' , true ) ;
123
119
expectSettersMethod ( component , 'hideDetail' , 'false' , 'hideDetail' , false ) ;
124
- expect ( component . calculateWidthHeaders ) . toHaveBeenCalled ( ) ;
125
120
} ) ;
126
121
127
122
it ( 'should call setColumnLink when set columns' , ( ) => {
@@ -164,19 +159,14 @@ describe('PoTableBaseComponent:', () => {
164
159
} ) ;
165
160
} ) ;
166
161
167
- it ( 'should set height and call calculateWidthHeaders' , ( ) => {
168
- spyOn ( component , 'calculateWidthHeaders' ) ;
169
-
162
+ it ( 'should set height' , ( ) => {
170
163
expectSettersMethod ( component , 'height' , 100 , 'height' , 100 ) ;
171
- expect ( component . calculateWidthHeaders ) . toHaveBeenCalled ( ) ;
172
164
} ) ;
173
165
174
- it ( 'should set columns and call calculateWidthHeaders' , ( ) => {
175
- spyOn ( component , 'calculateWidthHeaders' ) ;
166
+ it ( 'should set columns' , ( ) => {
176
167
component . columns = [ { property : 'teste' , label : 'label' } ] ;
177
168
178
169
expect ( component . columns ) . toEqual ( [ { property : 'teste' , label : 'label' } ] ) ;
179
- expect ( component . calculateWidthHeaders ) . toHaveBeenCalled ( ) ;
180
170
} ) ;
181
171
182
172
it ( 'should set hideSelectAll to true if singleSelect' , ( ) => {
@@ -1348,22 +1338,16 @@ describe('PoTableBaseComponent:', () => {
1348
1338
expectPropertiesValues ( component , 'loading' , booleanInvalidValues , false ) ;
1349
1339
} ) ;
1350
1340
1351
- it ( 'p-loading: should update property `p-loading` with valid values and call `calculateWidthHeaders`' , ( ) => {
1352
- spyOn ( component , 'calculateWidthHeaders' ) ;
1353
-
1341
+ it ( 'p-loading: should update property `p-loading` with valid values' , ( ) => {
1354
1342
expectPropertiesValues ( component , 'loading' , booleanValidTrueValues , true ) ;
1355
-
1356
- expect ( component . calculateWidthHeaders ) . toHaveBeenCalled ( ) ;
1357
1343
} ) ;
1358
1344
1359
- it ( 'p-columns: should call `setColumnLink` and `calculateWidthHeaders` if has values' , ( ) => {
1345
+ it ( 'p-columns: should call `setColumnLink` if has values' , ( ) => {
1360
1346
spyOn ( component , < any > 'setColumnLink' ) ;
1361
- spyOn ( component , 'calculateWidthHeaders' ) ;
1362
1347
1363
1348
component . columns = [ { label : 'table' , property : 'table' } ] ;
1364
1349
1365
1350
expect ( component [ 'setColumnLink' ] ) . toHaveBeenCalled ( ) ;
1366
- expect ( component . calculateWidthHeaders ) . toHaveBeenCalled ( ) ;
1367
1351
} ) ;
1368
1352
1369
1353
it ( 'p-columns, p-items: should call `getDefaultColumns` with item if doesn`t have columns but has items to set default column' , ( ) => {
0 commit comments