@@ -72,7 +72,7 @@ describe('Pivot pipes', () => {
72
72
it ( 'transforms flat data to pivot data' , ( ) => {
73
73
const rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
74
74
const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
75
- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates ) ;
75
+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
76
76
expect ( rowStatePipeResult ) . toEqual ( [
77
77
{ All : 2127 , 'All-Bulgaria' : 774 , 'All-USA' : 829 , 'All-Uruguay' : 524 , AllCategory : 'All' , AllCategory_level : 0 } ,
78
78
{ ProductCategory : 'Clothing' , All : 1526 , 'All-Bulgaria' : 774 , 'All-USA' : 296 , 'All-Uruguay' : 456 , ProductCategory_level : 1 } ,
@@ -166,7 +166,7 @@ describe('Pivot pipes', () => {
166
166
] , level : 0
167
167
} ] ) ;
168
168
const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
169
- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates ) ;
169
+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
170
170
expect ( rowStatePipeResult ) . toEqual ( [
171
171
{
172
172
ProductCategory : 'Clothing' , All : 1526 , 'All-Bulgaria' : 774 , 'All-USA' : 296 ,
@@ -183,7 +183,7 @@ describe('Pivot pipes', () => {
183
183
expanded . set ( 'All' , false ) ;
184
184
const rowPipeResult = rowPipe . transform ( data , pivotConfig , expanded ) ;
185
185
const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
186
- const rowPipeCollapseResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expanded ) ;
186
+ const rowPipeCollapseResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expanded , true ) ;
187
187
expect ( rowPipeCollapseResult ) . toEqual ( [
188
188
{
189
189
AllCategory : 'All' ,
@@ -196,7 +196,7 @@ describe('Pivot pipes', () => {
196
196
] ) ;
197
197
198
198
expanded . set ( 'All' , true ) ;
199
- const rowPipeExpandResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expanded ) ;
199
+ const rowPipeExpandResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expanded , true ) ;
200
200
expect ( rowPipeExpandResult ) . toEqual ( [
201
201
{ AllCategory : 'All' , All : 2127 , 'All-Bulgaria' : 774 , 'All-USA' : 829 , 'All-Uruguay' : 524 , AllCategory_level : 0 } ,
202
202
{ ProductCategory : 'Clothing' , All : 1526 , 'All-Bulgaria' : 774 , 'All-USA' : 296 , 'All-Uruguay' : 456 , ProductCategory_level : 1 } ,
@@ -219,7 +219,7 @@ describe('Pivot pipes', () => {
219
219
] ;
220
220
const rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
221
221
const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
222
- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates ) ;
222
+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
223
223
expect ( rowStatePipeResult ) . toEqual ( [
224
224
{ Date : '01/01/2021' , ProductCategory : 'Clothing' , All : 282 , 'All-Bulgaria' : 282 , ProductCategory_level : 0 , Date_level : 0 } ,
225
225
{ Date : '01/05/2019' , ProductCategory : 'Clothing' , All : 296 , 'All-USA' : 296 , ProductCategory_level : 0 , Date_level : 0 } ,
@@ -251,7 +251,7 @@ describe('Pivot pipes', () => {
251
251
} ] ;
252
252
const rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
253
253
const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
254
- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates ) ;
254
+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
255
255
expect ( rowStatePipeResult ) . toEqual ( [
256
256
{
257
257
All : 2127 , 'All-Bulgaria' : 774 , 'All-Uruguay' : 524 , 'All-USA' : 829 , AllDate : 'AllDate' ,
@@ -292,7 +292,7 @@ describe('Pivot pipes', () => {
292
292
} ] ;
293
293
const rowPipeResult = rowPipe . transform ( data , pivotConfig , new Map < any , boolean > ( ) ) ;
294
294
const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
295
- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
295
+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) , true ) ;
296
296
/* eslint-disable quote-props */
297
297
expect ( rowStatePipeResult ) . toEqual ( [
298
298
{
@@ -325,7 +325,7 @@ describe('Pivot pipes', () => {
325
325
} ] ;
326
326
const rowPipeResult = rowPipe . transform ( data , pivotConfig , new Map < any , boolean > ( ) ) ;
327
327
const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
328
- const rowStateResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
328
+ const rowStateResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) , true ) ;
329
329
/* eslint-disable quote-props */
330
330
expect ( rowStateResult ) . toEqual ( [
331
331
{
@@ -368,7 +368,7 @@ describe('Pivot pipes', () => {
368
368
] ;
369
369
const rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
370
370
const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
371
- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
371
+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) , true ) ;
372
372
expect ( rowStatePipeResult ) . toEqual ( [
373
373
{
374
374
'AllCategory' : 'All' , 'AllCategory_level' : 0 , 'All-UnitsSold' : 2127 ,
@@ -411,7 +411,7 @@ describe('Pivot pipes', () => {
411
411
412
412
const rowPipeResult = rowPipe . transform ( preprocessedData , pivotConfig , new Map < any , boolean > ( ) ) ;
413
413
const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
414
- const rowStateResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
414
+ const rowStateResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) , true ) ;
415
415
416
416
// same data but expanded
417
417
expect ( rowStateResult ) . toEqual (
@@ -705,7 +705,7 @@ describe('Pivot pipes', () => {
705
705
706
706
const rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
707
707
const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
708
- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates ) ;
708
+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
709
709
expect ( rowStatePipeResult . length ) . toEqual ( 44 ) ;
710
710
expect ( rowStatePipeResult [ 0 ] [ 'AllPeriods' ] ) . toEqual ( 'All Periods' ) ;
711
711
expect ( rowStatePipeResult [ 0 ] [ 'AllProducts' ] ) . toEqual ( 'All' ) ;
0 commit comments