@@ -1331,7 +1331,7 @@ describe('Pivot pipes #pivotGrid', () => {
1331
1331
let rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
1332
1332
let columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
1333
1333
let rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
1334
- expect ( rowStatePipeResult . length ) . toBe ( 77 ) ;
1334
+ expect ( rowStatePipeResult . length ) . toBe ( 84 ) ;
1335
1335
const prod_country_date_seller_discontinued = PivotGridFunctions . getDimensionData ( rowStatePipeResult , pivotConfig . rows ) ;
1336
1336
const allPeriods_allProducts_records = prod_country_date_seller_discontinued . filter ( x => x [ 'AllPeriods' ] === 'All Periods' &&
1337
1337
x [ 'AllProduct' ] === 'All Products' ) ;
@@ -1354,8 +1354,58 @@ describe('Pivot pipes #pivotGrid', () => {
1354
1354
]
1355
1355
) ;
1356
1356
1357
- // TODO - check the rest of the 'All Periods' fields here once issue: https://github.com/IgniteUI/igniteui-angular/issues/10680 is resolved.
1357
+ const allPeriods_clothing_records = prod_country_date_seller_discontinued . filter ( x => x [ 'AllPeriods' ] === 'All Periods' && x [ 'ProductCategory' ] === 'Clothing' ) ;
1358
+ expect ( allPeriods_clothing_records ) . toEqual ( [
1359
+ { AllPeriods : 'All Periods' , ProductCategory : 'Clothing' , AllCountries : 'All Countries' , SellerName : 'Stanley' , Discontinued : 'false' } ,
1360
+ { AllPeriods : 'All Periods' , ProductCategory : 'Clothing' , AllCountries : 'All Countries' , SellerName : 'Elisa' , Discontinued : 'true' } ,
1361
+ { AllPeriods : 'All Periods' , ProductCategory : 'Clothing' , AllCountries : 'All Countries' , SellerName : 'Larry' , Discontinued : 'true' } ,
1362
+ { AllPeriods : 'All Periods' , ProductCategory : 'Clothing' , AllCountries : 'All Countries' , SellerName : 'Walter' , Discontinued : 'false' } ,
1363
+ { AllPeriods : 'All Periods' , ProductCategory : 'Clothing' , Country : 'Bulgaria' , SellerName : 'Stanley' , Discontinued : 'false' } ,
1364
+ { AllPeriods : 'All Periods' , ProductCategory : 'Clothing' , Country : 'Bulgaria' , SellerName : 'Walter' , Discontinued : 'false' } ,
1365
+ { AllPeriods : 'All Periods' , ProductCategory : 'Clothing' , Country : 'USA' , SellerName : 'Elisa' , Discontinued : 'true' } ,
1366
+ { AllPeriods : 'All Periods' , ProductCategory : 'Clothing' , Country : 'Uruguay' , SellerName : 'Larry' , Discontinued : 'true' }
1367
+ ] ) ;
1368
+ const allPeriods_accessories_records = prod_country_date_seller_discontinued . filter ( x => x [ 'AllPeriods' ] === 'All Periods' && x [ 'ProductCategory' ] === 'Accessories' ) ;
1369
+ expect ( allPeriods_accessories_records ) . toEqual ( [
1370
+ { AllPeriods : 'All Periods' , ProductCategory : 'Accessories' , AllCountries : 'All Countries' , SellerName : 'David' , Discontinued : 'false' } ,
1371
+ { AllPeriods : 'All Periods' , ProductCategory : 'Accessories' , Country : 'USA' , SellerName : 'David' , Discontinued : 'false' }
1372
+ ] ) ;
1373
+ const allPeriods_components_records = prod_country_date_seller_discontinued . filter ( x => x [ 'AllPeriods' ] === 'All Periods' && x [ 'ProductCategory' ] === 'Components' ) ;
1374
+ expect ( allPeriods_components_records ) . toEqual ( [
1375
+ { AllPeriods : 'All Periods' , ProductCategory : 'Components' , AllCountries : 'All Countries' , SellerName : 'John' , Discontinued : 'false' } ,
1376
+ { AllPeriods : 'All Periods' , ProductCategory : 'Components' , Country : 'USA' , SellerName : 'John' , Discontinued : 'false' }
1377
+ ] ) ;
1378
+ const allPeriods_bikes_records = prod_country_date_seller_discontinued . filter ( x => x [ 'AllPeriods' ] === 'All Periods' && x [ 'ProductCategory' ] === 'Bikes' ) ;
1379
+ expect ( allPeriods_bikes_records ) . toEqual ( [
1380
+ { AllPeriods : 'All Periods' , ProductCategory : 'Bikes' , AllCountries : 'All Countries' , SellerName : 'Lydia' , Discontinued : 'true' } ,
1381
+ { AllPeriods : 'All Periods' , ProductCategory : 'Bikes' , Country : 'Uruguay' , SellerName : 'Lydia' , Discontinued : 'true' }
1382
+ ] ) ;
1383
+
1384
+ // 2021
1385
+ const year_2021_records = prod_country_date_seller_discontinued . filter ( x => x [ 'Years' ] === '2021' ) ;
1386
+ expect ( year_2021_records ) . toEqual ( [
1387
+ { Years : '2021' , AllProduct : 'All Products' , AllCountries : 'All Countries' , SellerName : 'Stanley' , Discontinued : 'false' } ,
1388
+ { Years : '2021' , AllProduct : 'All Products' , AllCountries : 'All Countries' , SellerName : 'David' , Discontinued : 'false' } ,
1389
+ { Years : '2021' , AllProduct : 'All Products' , AllCountries : 'All Countries' , SellerName : 'John' , Discontinued : 'false' } ,
1390
+ { Years : '2021' , AllProduct : 'All Products' , Country : 'Bulgaria' , SellerName : 'Stanley' , Discontinued : 'false' } ,
1391
+ { Years : '2021' , AllProduct : 'All Products' , Country : 'USA' , SellerName : 'David' , Discontinued : 'false' } ,
1392
+ { Years : '2021' , AllProduct : 'All Products' , Country : 'USA' , SellerName : 'John' , Discontinued : 'false' } ,
1393
+ { Years : '2021' , ProductCategory : 'Clothing' , AllCountries : 'All Countries' , SellerName : 'Stanley' , Discontinued : 'false' } ,
1394
+ { Years : '2021' , ProductCategory : 'Clothing' , Country : 'Bulgaria' , SellerName : 'Stanley' , Discontinued : 'false' } ,
1395
+ { Years : '2021' , ProductCategory : 'Accessories' , AllCountries : 'All Countries' , SellerName : 'David' , Discontinued : 'false' } ,
1396
+ { Years : '2021' , ProductCategory : 'Accessories' , Country : 'USA' , SellerName : 'David' , Discontinued : 'false' } ,
1397
+ { Years : '2021' , ProductCategory : 'Components' , AllCountries : 'All Countries' , SellerName : 'John' , Discontinued : 'false' } ,
1398
+ { Years : '2021' , ProductCategory : 'Components' , Country : 'USA' , SellerName : 'John' , Discontinued : 'false' } ,
1399
+ ] ) ;
1358
1400
1401
+ // 01/01/2021
1402
+ const date_2021_clothing_records = prod_country_date_seller_discontinued . filter ( x => x [ 'Date' ] === '01/01/2021' ) ;
1403
+ expect ( date_2021_clothing_records ) . toEqual ( [
1404
+ { Date : '01/01/2021' , AllProduct : 'All Products' , AllCountries : 'All Countries' , SellerName : 'Stanley' , Discontinued : 'false' } ,
1405
+ { Date : '01/01/2021' , AllProduct : 'All Products' , Country : 'Bulgaria' , SellerName : 'Stanley' , Discontinued : 'false' } ,
1406
+ { Date : '01/01/2021' , ProductCategory : 'Clothing' , AllCountries : 'All Countries' , SellerName : 'Stanley' , Discontinued : 'false' } ,
1407
+ { Date : '01/01/2021' , ProductCategory : 'Clothing' , Country : 'Bulgaria' , SellerName : 'Stanley' , Discontinued : 'false' }
1408
+ ] ) ;
1359
1409
// Discontinued, Date, Product, Country, Seller
1360
1410
pivotConfig . rows = [
1361
1411
dims [ 4 ] ,
@@ -1368,12 +1418,12 @@ describe('Pivot pipes #pivotGrid', () => {
1368
1418
rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
1369
1419
columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
1370
1420
rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
1371
- expect ( rowStatePipeResult . length ) . toBe ( 77 ) ;
1421
+ expect ( rowStatePipeResult . length ) . toBe ( 84 ) ;
1372
1422
const discontinued_prod_country_date_seller = PivotGridFunctions . getDimensionData ( rowStatePipeResult , pivotConfig . rows ) ;
1373
1423
const ongoing_records = discontinued_prod_country_date_seller . filter ( x => x [ 'Discontinued' ] === 'false' ) ;
1374
1424
const discontinued_records = discontinued_prod_country_date_seller . filter ( x => x [ 'Discontinued' ] === 'true' ) ;
1375
- expect ( discontinued_records . length ) . toBe ( 33 ) ;
1376
- expect ( ongoing_records . length ) . toBe ( 44 ) ;
1425
+ expect ( discontinued_records . length ) . toBe ( 36 ) ;
1426
+ expect ( ongoing_records . length ) . toBe ( 48 ) ;
1377
1427
const ongoing_allPeriods = ongoing_records . filter ( x => x [ 'AllPeriods' ] === 'All Periods' ) ;
1378
1428
expect ( ongoing_allPeriods ) . toEqual ( [
1379
1429
{ Discontinued : 'false' , AllPeriods : 'All Periods' , AllProduct : 'All Products' , AllCountries : 'All Countries' , SellerName : 'Stanley' } ,
@@ -1452,7 +1502,7 @@ describe('Pivot pipes #pivotGrid', () => {
1452
1502
rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
1453
1503
columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
1454
1504
rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
1455
- expect ( rowStatePipeResult . length ) . toBe ( 73 ) ;
1505
+ expect ( rowStatePipeResult . length ) . toBe ( 84 ) ;
1456
1506
const date_prod_disc_seller = PivotGridFunctions . getDimensionData ( rowStatePipeResult , pivotConfig . rows ) ;
1457
1507
1458
1508
const date_allPeriods_allProducts_records = date_prod_disc_seller . filter ( x => x [ 'AllPeriods' ] === 'All Periods' && x [ 'AllProduct' ] === 'All Products' ) ;
0 commit comments