@@ -921,18 +921,19 @@ describe('CdkTable', () => {
921
921
headerRows [ 0 ] . getBoundingClientRect ( ) . height ,
922
922
undefined ,
923
923
headerRows [ 2 ] . getBoundingClientRect ( ) . height ,
924
- ]
924
+ ] ,
925
+ elements : [ [ headerRows [ 0 ] ] , undefined , [ headerRows [ 2 ] ] ] ,
925
926
} ) ;
926
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
927
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
927
928
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
928
929
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
929
930
930
931
component . stickyHeaders = [ ] ;
931
932
fixture . detectChanges ( ) ;
932
933
flushMicrotasks ( ) ;
933
934
expectNoStickyStyles ( headerRows ) ;
934
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
935
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
935
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
936
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
936
937
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
937
938
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
938
939
} ) ) ;
@@ -948,13 +949,14 @@ describe('CdkTable', () => {
948
949
expectNoStickyStyles ( [ footerRows [ 1 ] ] ) ;
949
950
expectStickyStyles ( footerRows [ 2 ] , '10' , { bottom : '0px' } ) ;
950
951
expectStickyBorderClass ( footerRows [ 2 ] ) ;
951
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
952
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
952
953
expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
953
954
sizes : [
954
955
footerRows [ 2 ] . getBoundingClientRect ( ) . height ,
955
956
undefined ,
956
- footerRows [ 1 ] . getBoundingClientRect ( ) . height ,
957
- ]
957
+ footerRows [ 0 ] . getBoundingClientRect ( ) . height ,
958
+ ] ,
959
+ elements : [ [ footerRows [ 2 ] ] , undefined , [ footerRows [ 0 ] ] ] ,
958
960
} ) ;
959
961
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
960
962
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
@@ -963,8 +965,8 @@ describe('CdkTable', () => {
963
965
fixture . detectChanges ( ) ;
964
966
flushMicrotasks ( ) ;
965
967
expectNoStickyStyles ( footerRows ) ;
966
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
967
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
968
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
969
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
968
970
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
969
971
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
970
972
} ) ) ;
@@ -1008,8 +1010,8 @@ describe('CdkTable', () => {
1008
1010
expectStickyBorderClass ( cells [ 2 ] , { left : true } ) ;
1009
1011
expectNoStickyStyles ( [ cells [ 1 ] , cells [ 3 ] , cells [ 4 ] , cells [ 5 ] ] ) ;
1010
1012
} ) ;
1011
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1012
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1013
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1014
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1013
1015
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
1014
1016
sizes : [
1015
1017
getCells ( dataRows [ 0 ] ) [ 0 ] . getBoundingClientRect ( ) . width ,
@@ -1026,8 +1028,8 @@ describe('CdkTable', () => {
1026
1028
headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
1027
1029
dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
1028
1030
footerRows . forEach ( row => expectNoStickyStyles ( getFooterCells ( row ) ) ) ;
1029
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1030
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1031
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1032
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1031
1033
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1032
1034
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1033
1035
} ) ) ;
@@ -1061,8 +1063,8 @@ describe('CdkTable', () => {
1061
1063
expectStickyBorderClass ( cells [ 3 ] , { right : true } ) ;
1062
1064
expectNoStickyStyles ( [ cells [ 0 ] , cells [ 1 ] , cells [ 2 ] , cells [ 4 ] ] ) ;
1063
1065
} ) ;
1064
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1065
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1066
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1067
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1066
1068
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1067
1069
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( {
1068
1070
sizes : [
@@ -1078,8 +1080,8 @@ describe('CdkTable', () => {
1078
1080
headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
1079
1081
dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
1080
1082
footerRows . forEach ( row => expectNoStickyStyles ( getFooterCells ( row ) ) ) ;
1081
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1082
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1083
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1084
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1083
1085
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1084
1086
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1085
1087
} ) ) ;
@@ -1166,10 +1168,12 @@ describe('CdkTable', () => {
1166
1168
expectNoStickyStyles ( [ footerRows [ 0 ] , footerRows [ 1 ] ] ) ;
1167
1169
1168
1170
expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( {
1169
- sizes : [ headerRows [ 0 ] . getBoundingClientRect ( ) . height ]
1171
+ sizes : [ headerRows [ 0 ] . getBoundingClientRect ( ) . height ] ,
1172
+ elements : [ [ headerRows [ 0 ] ] ] ,
1170
1173
} ) ;
1171
1174
expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
1172
- sizes : [ footerRows [ 2 ] . getBoundingClientRect ( ) . height ]
1175
+ sizes : [ footerRows [ 2 ] . getBoundingClientRect ( ) . height ] ,
1176
+ elements : [ [ footerRows [ 2 ] ] ] ,
1173
1177
} ) ;
1174
1178
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
1175
1179
sizes : [ getCells ( dataRows [ 0 ] ) [ 0 ] . getBoundingClientRect ( ) . width ]
@@ -1189,8 +1193,8 @@ describe('CdkTable', () => {
1189
1193
dataRows . forEach ( row => expectNoStickyStyles ( [ row , ...getCells ( row ) ] ) ) ;
1190
1194
footerRows . forEach ( row => expectNoStickyStyles ( [ row , ...getFooterCells ( row ) ] ) ) ;
1191
1195
1192
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1193
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1196
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1197
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1194
1198
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1195
1199
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1196
1200
} ) ) ;
@@ -1230,9 +1234,10 @@ describe('CdkTable', () => {
1230
1234
headerRows [ 0 ] . getBoundingClientRect ( ) . height ,
1231
1235
undefined ,
1232
1236
headerRows [ 2 ] . getBoundingClientRect ( ) . height ,
1233
- ]
1237
+ ] ,
1238
+ elements : [ getHeaderCells ( headerRows [ 0 ] ) , undefined , getHeaderCells ( headerRows [ 2 ] ) ] ,
1234
1239
} ) ;
1235
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1240
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1236
1241
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1237
1242
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1238
1243
@@ -1241,8 +1246,8 @@ describe('CdkTable', () => {
1241
1246
flushMicrotasks ( ) ;
1242
1247
expectNoStickyStyles ( headerRows ) ; // No sticky styles on rows for native table
1243
1248
headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
1244
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1245
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1249
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1250
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1246
1251
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1247
1252
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1248
1253
} ) ) ;
@@ -1263,13 +1268,14 @@ describe('CdkTable', () => {
1263
1268
} ) ;
1264
1269
expectNoStickyStyles ( getFooterCells ( footerRows [ 1 ] ) ) ;
1265
1270
expectNoStickyStyles ( footerRows ) ; // No sticky styles on rows for native table
1266
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1271
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1267
1272
expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
1268
1273
sizes : [
1269
1274
footerRows [ 2 ] . getBoundingClientRect ( ) . height ,
1270
1275
undefined ,
1271
- footerRows [ 1 ] . getBoundingClientRect ( ) . height ,
1272
- ]
1276
+ footerRows [ 0 ] . getBoundingClientRect ( ) . height ,
1277
+ ] ,
1278
+ elements : [ getFooterCells ( footerRows [ 2 ] ) , undefined , getFooterCells ( footerRows [ 0 ] ) ] ,
1273
1279
} ) ;
1274
1280
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1275
1281
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
@@ -1279,8 +1285,8 @@ describe('CdkTable', () => {
1279
1285
flushMicrotasks ( ) ;
1280
1286
expectNoStickyStyles ( footerRows ) ; // No sticky styles on rows for native table
1281
1287
footerRows . forEach ( row => expectNoStickyStyles ( getFooterCells ( row ) ) ) ;
1282
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1283
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1288
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1289
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1284
1290
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1285
1291
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1286
1292
} ) ) ;
@@ -1333,14 +1339,14 @@ describe('CdkTable', () => {
1333
1339
expectStickyBorderClass ( cells [ 2 ] , { left : true } ) ;
1334
1340
expectNoStickyStyles ( [ cells [ 1 ] , cells [ 3 ] , cells [ 4 ] , cells [ 5 ] ] ) ;
1335
1341
} ) ;
1336
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1337
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1342
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1343
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1338
1344
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
1339
1345
sizes : [
1340
1346
getCells ( dataRows [ 0 ] ) [ 0 ] . getBoundingClientRect ( ) . width ,
1341
1347
null ,
1342
1348
getCells ( dataRows [ 0 ] ) [ 2 ] . getBoundingClientRect ( ) . width ,
1343
- ]
1349
+ ] ,
1344
1350
} ) ;
1345
1351
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1346
1352
@@ -1350,8 +1356,8 @@ describe('CdkTable', () => {
1350
1356
headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
1351
1357
dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
1352
1358
footerRows . forEach ( row => expectNoStickyStyles ( getFooterCells ( row ) ) ) ;
1353
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1354
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1359
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1360
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1355
1361
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1356
1362
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1357
1363
} ) ) ;
@@ -1385,8 +1391,8 @@ describe('CdkTable', () => {
1385
1391
expectStickyBorderClass ( cells [ 3 ] , { right : true } ) ;
1386
1392
expectNoStickyStyles ( [ cells [ 0 ] , cells [ 1 ] , cells [ 2 ] , cells [ 4 ] ] ) ;
1387
1393
} ) ;
1388
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1389
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1394
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1395
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1390
1396
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1391
1397
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( {
1392
1398
sizes : [
@@ -1402,8 +1408,8 @@ describe('CdkTable', () => {
1402
1408
headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
1403
1409
dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
1404
1410
footerRows . forEach ( row => expectNoStickyStyles ( getFooterCells ( row ) ) ) ;
1405
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1406
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1411
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1412
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1407
1413
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1408
1414
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1409
1415
} ) ) ;
@@ -1457,10 +1463,12 @@ describe('CdkTable', () => {
1457
1463
expectNoStickyStyles ( footerRows ) ;
1458
1464
1459
1465
expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( {
1460
- sizes : [ headerRows [ 0 ] . getBoundingClientRect ( ) . height ]
1466
+ sizes : [ headerRows [ 0 ] . getBoundingClientRect ( ) . height ] ,
1467
+ elements : [ getHeaderCells ( headerRows [ 0 ] ) ] ,
1461
1468
} ) ;
1462
1469
expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
1463
- sizes : [ footerRows [ 2 ] . getBoundingClientRect ( ) . height ]
1470
+ sizes : [ footerRows [ 2 ] . getBoundingClientRect ( ) . height ] ,
1471
+ elements : [ getFooterCells ( footerRows [ 2 ] ) ] ,
1464
1472
} ) ;
1465
1473
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
1466
1474
sizes : [ getCells ( dataRows [ 0 ] ) [ 0 ] . getBoundingClientRect ( ) . width ]
@@ -1480,8 +1488,8 @@ describe('CdkTable', () => {
1480
1488
dataRows . forEach ( row => expectNoStickyStyles ( [ row , ...getCells ( row ) ] ) ) ;
1481
1489
footerRows . forEach ( row => expectNoStickyStyles ( [ row , ...getFooterCells ( row ) ] ) ) ;
1482
1490
1483
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1484
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1491
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1492
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1485
1493
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1486
1494
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1487
1495
} ) ) ;
0 commit comments