@@ -72,7 +72,7 @@ describe('Pivot pipes', () => {
7272 it ( 'transforms flat data to pivot data' , ( ) => {
7373 const rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
7474 const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
75- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates ) ;
75+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
7676 expect ( rowStatePipeResult ) . toEqual ( [
7777 { All : 2127 , 'All-Bulgaria' : 774 , 'All-USA' : 829 , 'All-Uruguay' : 524 , AllCategory : 'All' , AllCategory_level : 0 } ,
7878 { ProductCategory : 'Clothing' , All : 1526 , 'All-Bulgaria' : 774 , 'All-USA' : 296 , 'All-Uruguay' : 456 , ProductCategory_level : 1 } ,
@@ -175,7 +175,7 @@ describe('Pivot pipes', () => {
175175 ] , level : 0
176176 } ] ) ;
177177 const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
178- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates ) ;
178+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
179179 expect ( rowStatePipeResult ) . toEqual ( [
180180 {
181181 ProductCategory : 'Clothing' , All : 1526 , 'All-Bulgaria' : 774 , 'All-USA' : 296 ,
@@ -192,7 +192,7 @@ describe('Pivot pipes', () => {
192192 expanded . set ( 'All' , false ) ;
193193 const rowPipeResult = rowPipe . transform ( data , pivotConfig , expanded ) ;
194194 const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
195- const rowPipeCollapseResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expanded ) ;
195+ const rowPipeCollapseResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expanded , true ) ;
196196 expect ( rowPipeCollapseResult ) . toEqual ( [
197197 {
198198 AllCategory : 'All' ,
@@ -205,7 +205,7 @@ describe('Pivot pipes', () => {
205205 ] ) ;
206206
207207 expanded . set ( 'All' , true ) ;
208- const rowPipeExpandResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expanded ) ;
208+ const rowPipeExpandResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expanded , true ) ;
209209 expect ( rowPipeExpandResult ) . toEqual ( [
210210 { AllCategory : 'All' , All : 2127 , 'All-Bulgaria' : 774 , 'All-USA' : 829 , 'All-Uruguay' : 524 , AllCategory_level : 0 } ,
211211 { ProductCategory : 'Clothing' , All : 1526 , 'All-Bulgaria' : 774 , 'All-USA' : 296 , 'All-Uruguay' : 456 , ProductCategory_level : 1 } ,
@@ -236,7 +236,7 @@ describe('Pivot pipes', () => {
236236 ] ;
237237 const rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
238238 const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
239- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates ) ;
239+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
240240 expect ( rowStatePipeResult ) . toEqual ( [
241241 { Date : '01/01/2021' , ProductCategory : 'Clothing' , All : 282 , 'All-Bulgaria' : 282 , ProductCategory_level : 0 , Date_level : 0 } ,
242242 { Date : '01/05/2019' , ProductCategory : 'Clothing' , All : 296 , 'All-USA' : 296 , ProductCategory_level : 0 , Date_level : 0 } ,
@@ -268,7 +268,7 @@ describe('Pivot pipes', () => {
268268 } ] ;
269269 const rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
270270 const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
271- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates ) ;
271+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , expansionStates , true ) ;
272272 expect ( rowStatePipeResult ) . toEqual ( [
273273 {
274274 'AllDate' : 'AllDate' , 'AllProd' : 'AllProd' , 'All' : 2127 , 'All-Bulgaria' : 774 , 'All-USA' : 829 , 'All-Uruguay' : 524 , 'AllProd_level' : 0 ,
@@ -363,7 +363,7 @@ describe('Pivot pipes', () => {
363363 } ] ;
364364 const rowPipeResult = rowPipe . transform ( data , pivotConfig , new Map < any , boolean > ( ) ) ;
365365 const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
366- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
366+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) , true ) ;
367367 /* eslint-disable quote-props */
368368 expect ( rowStatePipeResult ) . toEqual ( [
369369 {
@@ -404,7 +404,7 @@ describe('Pivot pipes', () => {
404404 } ] ;
405405 const rowPipeResult = rowPipe . transform ( data , pivotConfig , new Map < any , boolean > ( ) ) ;
406406 const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
407- const rowStateResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
407+ const rowStateResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) , true ) ;
408408 /* eslint-disable quote-props */
409409 expect ( rowStateResult ) . toEqual (
410410 [
@@ -458,7 +458,7 @@ describe('Pivot pipes', () => {
458458 ] ;
459459 const rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
460460 const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
461- const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
461+ const rowStatePipeResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) , true ) ;
462462 expect ( rowStatePipeResult ) . toEqual (
463463 [
464464 {
@@ -507,7 +507,7 @@ describe('Pivot pipes', () => {
507507
508508 const rowPipeResult = rowPipe . transform ( preprocessedData , pivotConfig , new Map < any , boolean > ( ) ) ;
509509 const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
510- const rowStateResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) ) ;
510+ const rowStateResult = rowStatePipe . transform ( columnPipeResult , pivotConfig , new Map < any , boolean > ( ) , true ) ;
511511
512512 // same data but expanded
513513 expect ( rowStateResult ) . toEqual (
@@ -814,7 +814,7 @@ describe('Pivot pipes', () => {
814814
815815 const rowPipeResult = rowPipe . transform ( data , pivotConfig , expansionStates ) ;
816816 const colPipeRes = columnPipe . transform ( rowPipeResult , pivotConfig , expansionStates ) ;
817- const rowStatePipeResult = rowStatePipe . transform ( colPipeRes , pivotConfig , expansionStates ) ;
817+ const rowStatePipeResult = rowStatePipe . transform ( colPipeRes , pivotConfig , expansionStates , true ) ;
818818 expect ( rowStatePipeResult . length ) . toEqual ( 39 ) ;
819819 expect ( rowStatePipeResult [ 0 ] [ 'AllPeriods' ] ) . toEqual ( 'All Periods' ) ;
820820 expect ( rowStatePipeResult [ 0 ] [ 'AllProducts' ] ) . toEqual ( 'All' ) ;
0 commit comments