@@ -2,7 +2,7 @@ import { IgxNumberSummaryOperand } from '../summaries/grid-summary';
22import { IPivotConfiguration , IPivotValue } from './pivot-grid.interface' ;
33import { IgxPivotColumnPipe , IgxPivotRowPipe } from './pivot-grid.pipes' ;
44
5- describe ( 'Pivot pipes' , ( ) => {
5+ fdescribe ( 'Pivot pipes' , ( ) => {
66 // This pipe is a pure, stateless function so no need for BeforeEach
77 const rowPipe = new IgxPivotRowPipe ( ) ;
88 const columnPipe = new IgxPivotColumnPipe ( ) ;
@@ -113,7 +113,7 @@ describe('Pivot pipes', () => {
113113 expect ( rowPipeCollapseResult ) . toEqual ( [
114114 { field1 :'All' , records : [
115115 {
116- field1 :'All- Clothing' ,
116+ field1 :'Clothing' ,
117117 records :[
118118 { ProductCategory :'Clothing' , UnitPrice :12.81 , SellerName :'Stanley' , Country :'Bulgaria' , Date :'01/01/2021' , UnitsSold :282 } ,
119119 { ProductCategory :'Clothing' , UnitPrice :49.57 , SellerName :'Elisa' , Country :'USA' , Date :'01/05/2019' , UnitsSold :296 } ,
@@ -123,20 +123,20 @@ describe('Pivot pipes', () => {
123123 , level :1
124124 } ,
125125 {
126- field1 :'All- Bikes' ,
126+ field1 :'Bikes' ,
127127 records :[
128128 { ProductCategory :'Bikes' , UnitPrice :3.56 , SellerName :'Lydia' , Country :'Uruguay' , Date :'01/06/2020' , UnitsSold :68 }
129129 ]
130130 , level :1
131131 } ,
132132 {
133- field1 :'All- Accessories' ,
133+ field1 :'Accessories' ,
134134 records :[
135135 { ProductCategory :'Accessories' , UnitPrice :85.58 , SellerName :'David' , Country :'USA' , Date :'04/07/2021' , UnitsSold :293 }
136136 ]
137137 , level :1 } ,
138138 {
139- field1 :'All- Components' ,
139+ field1 :'Components' ,
140140 records :[
141141 { ProductCategory :'Components' , UnitPrice :18.13 , SellerName :'John' , Country :'USA' , Date :'12/08/2021' , UnitsSold :240 }
142142 ]
@@ -150,7 +150,7 @@ describe('Pivot pipes', () => {
150150 expect ( rowPipeExpandResult ) . toEqual ( [
151151 { field1 :'All' , records : [
152152 {
153- field1 :'All- Clothing' ,
153+ field1 :'Clothing' ,
154154 records :[
155155 { ProductCategory :'Clothing' , UnitPrice :12.81 , SellerName :'Stanley' , Country :'Bulgaria' , Date :'01/01/2021' , UnitsSold :282 } ,
156156 { ProductCategory :'Clothing' , UnitPrice :49.57 , SellerName :'Elisa' , Country :'USA' , Date :'01/05/2019' , UnitsSold :296 } ,
@@ -160,28 +160,28 @@ describe('Pivot pipes', () => {
160160 , level :1
161161 } ,
162162 {
163- field1 :'All- Bikes' ,
163+ field1 :'Bikes' ,
164164 records :[
165165 { ProductCategory :'Bikes' , UnitPrice :3.56 , SellerName :'Lydia' , Country :'Uruguay' , Date :'01/06/2020' , UnitsSold :68 }
166166 ]
167167 , level :1
168168 } ,
169169 {
170- field1 :'All- Accessories' ,
170+ field1 :'Accessories' ,
171171 records :[
172172 { ProductCategory :'Accessories' , UnitPrice :85.58 , SellerName :'David' , Country :'USA' , Date :'04/07/2021' , UnitsSold :293 }
173173 ]
174174 , level :1 } ,
175175 {
176- field1 :'All- Components' ,
176+ field1 :'Components' ,
177177 records :[
178178 { ProductCategory :'Components' , UnitPrice :18.13 , SellerName :'John' , Country :'USA' , Date :'12/08/2021' , UnitsSold :240 }
179179 ]
180180 , level :1 }
181181 ]
182182 , level :0 } ,
183183 {
184- field1 :'All- Clothing' ,
184+ field1 :'Clothing' ,
185185 records :[
186186 { ProductCategory :'Clothing' , UnitPrice :12.81 , SellerName :'Stanley' , Country :'Bulgaria' , Date :'01/01/2021' , UnitsSold :282 } ,
187187 { ProductCategory :'Clothing' , UnitPrice :49.57 , SellerName :'Elisa' , Country :'USA' , Date :'01/05/2019' , UnitsSold :296 } ,
@@ -191,20 +191,20 @@ describe('Pivot pipes', () => {
191191 , level :1
192192 } ,
193193 {
194- field1 :'All- Bikes' ,
194+ field1 :'Bikes' ,
195195 records :[
196196 { ProductCategory :'Bikes' , UnitPrice :3.56 , SellerName :'Lydia' , Country :'Uruguay' , Date :'01/06/2020' , UnitsSold :68 }
197197 ]
198198 , level :1
199199 } ,
200200 {
201- field1 :'All- Accessories' ,
201+ field1 :'Accessories' ,
202202 records :[
203203 { ProductCategory :'Accessories' , UnitPrice :85.58 , SellerName :'David' , Country :'USA' , Date :'04/07/2021' , UnitsSold :293 }
204204 ]
205205 , level :1 } ,
206206 {
207- field1 :'All- Components' ,
207+ field1 :'Components' ,
208208 records :[
209209 { ProductCategory :'Components' , UnitPrice :18.13 , SellerName :'John' , Country :'USA' , Date :'12/08/2021' , UnitsSold :240 }
210210 ]
@@ -348,19 +348,19 @@ describe('Pivot pipes', () => {
348348 /* eslint-disable quote-props */
349349 expect ( columnPipeResult ) . toEqual ( [
350350 { 'field1' :'All' , 'records' :[
351- { 'field1' :'All- Clothing' , 'level' :1 , 'Bulgaria' :774 , 'Bulgaria-01/01/2021' :282 ,
351+ { 'field1' :'Clothing' , 'level' :1 , 'Bulgaria' :774 , 'Bulgaria-01/01/2021' :282 ,
352352 'Bulgaria-02/19/2020' :492 , 'USA' :296 , 'USA-01/05/2019' :296 , 'Uruguay' :456 , 'Uruguay-05/12/2020' :456 } ,
353- { 'field1' :'All- Bikes' , 'level' :1 , 'Uruguay' :68 , 'Uruguay-01/06/2020' :68 } ,
354- { 'field1' :'All- Accessories' , 'level' :1 , 'USA' :293 , 'USA-04/07/2021' :293 } ,
355- { 'field1' :'All- Components' , 'level' :1 , 'USA' :240 , 'USA-12/08/2021' :240 } ]
353+ { 'field1' :'Bikes' , 'level' :1 , 'Uruguay' :68 , 'Uruguay-01/06/2020' :68 } ,
354+ { 'field1' :'Accessories' , 'level' :1 , 'USA' :293 , 'USA-04/07/2021' :293 } ,
355+ { 'field1' :'Components' , 'level' :1 , 'USA' :240 , 'USA-12/08/2021' :240 } ]
356356 , 'level' :0 , 'Bulgaria' :774 , 'Bulgaria-01/01/2021' :282 , 'Bulgaria-02/19/2020' :492 ,
357357 'USA' :829 , 'USA-01/05/2019' :296 , 'USA-04/07/2021' :293 , 'USA-12/08/2021' :240 ,
358358 'Uruguay' :524 , 'Uruguay-05/12/2020' :456 , 'Uruguay-01/06/2020' :68 } ,
359- { 'field1' :'All- Clothing' , 'level' :1 , 'Bulgaria' :774 , 'Bulgaria-01/01/2021' :282 ,
359+ { 'field1' :'Clothing' , 'level' :1 , 'Bulgaria' :774 , 'Bulgaria-01/01/2021' :282 ,
360360 'Bulgaria-02/19/2020' :492 , 'USA' :296 , 'USA-01/05/2019' :296 , 'Uruguay' :456 , 'Uruguay-05/12/2020' :456 } ,
361- { 'field1' :'All- Bikes' , 'level' :1 , 'Uruguay' :68 , 'Uruguay-01/06/2020' :68 } ,
362- { 'field1' :'All- Accessories' , 'level' :1 , 'USA' :293 , 'USA-04/07/2021' :293 } ,
363- { 'field1' :'All- Components' , 'level' :1 , 'USA' :240 , 'USA-12/08/2021' :240 } ] ) ;
361+ { 'field1' :'Bikes' , 'level' :1 , 'Uruguay' :68 , 'Uruguay-01/06/2020' :68 } ,
362+ { 'field1' :'Accessories' , 'level' :1 , 'USA' :293 , 'USA-04/07/2021' :293 } ,
363+ { 'field1' :'Components' , 'level' :1 , 'USA' :240 , 'USA-12/08/2021' :240 } ] ) ;
364364 } ) ;
365365
366366 it ( 'transforms flat data to pivot data 3 column dimensions' , ( ) => {
@@ -384,23 +384,23 @@ describe('Pivot pipes', () => {
384384 expect ( columnPipeResult ) . toEqual ( [
385385 { 'field1' :'All' , 'records' :
386386 [
387- { 'field1' :'All- Clothing' , 'level' :1 , 'Bulgaria' :774 , 'Bulgaria-Stanley' :282 , 'Bulgaria-Stanley-01/01/2021' :282 ,
387+ { 'field1' :'Clothing' , 'level' :1 , 'Bulgaria' :774 , 'Bulgaria-Stanley' :282 , 'Bulgaria-Stanley-01/01/2021' :282 ,
388388 'Bulgaria-Walter' :492 , 'Bulgaria-Walter-02/19/2020' :492 , 'USA' :296 , 'USA-Elisa' :296 , 'USA-Elisa-01/05/2019' :296 ,
389389 'Uruguay' :456 , 'Uruguay-Larry' :456 , 'Uruguay-Larry-05/12/2020' :456 } ,
390- { 'field1' :'All- Bikes' , 'level' :1 , 'Uruguay' :68 , 'Uruguay-Lydia' :68 , 'Uruguay-Lydia-01/06/2020' :68 } ,
391- { 'field1' :'All- Accessories' , 'level' :1 , 'USA' :293 , 'USA-David' :293 , 'USA-David-04/07/2021' :293 } ,
392- { 'field1' :'All- Components' , 'level' :1 , 'USA' :240 , 'USA-John' :240 , 'USA-John-12/08/2021' :240 }
390+ { 'field1' :'Bikes' , 'level' :1 , 'Uruguay' :68 , 'Uruguay-Lydia' :68 , 'Uruguay-Lydia-01/06/2020' :68 } ,
391+ { 'field1' :'Accessories' , 'level' :1 , 'USA' :293 , 'USA-David' :293 , 'USA-David-04/07/2021' :293 } ,
392+ { 'field1' :'Components' , 'level' :1 , 'USA' :240 , 'USA-John' :240 , 'USA-John-12/08/2021' :240 }
393393 ] ,
394394 'level' :0 , 'Bulgaria' :774 , 'Bulgaria-Stanley' :282 , 'Bulgaria-Stanley-01/01/2021' :282 , 'Bulgaria-Walter' :492 ,
395395 'Bulgaria-Walter-02/19/2020' :492 , 'USA' :829 , 'USA-Elisa' :296 , 'USA-Elisa-01/05/2019' :296 , 'USA-David' :293 ,
396396 'USA-David-04/07/2021' :293 , 'USA-John' :240 , 'USA-John-12/08/2021' :240 , 'Uruguay' :524 , 'Uruguay-Larry' :456 ,
397397 'Uruguay-Larry-05/12/2020' :456 , 'Uruguay-Lydia' :68 , 'Uruguay-Lydia-01/06/2020' :68 } ,
398- { 'field1' :'All- Clothing' , 'level' :1 , 'Bulgaria' :774 , 'Bulgaria-Stanley' :282 , 'Bulgaria-Stanley-01/01/2021' :282 ,
398+ { 'field1' :'Clothing' , 'level' :1 , 'Bulgaria' :774 , 'Bulgaria-Stanley' :282 , 'Bulgaria-Stanley-01/01/2021' :282 ,
399399 'Bulgaria-Walter' :492 , 'Bulgaria-Walter-02/19/2020' :492 , 'USA' :296 , 'USA-Elisa' :296 , 'USA-Elisa-01/05/2019' :296 , 'Uruguay' :456 ,
400400 'Uruguay-Larry' :456 , 'Uruguay-Larry-05/12/2020' :456 } ,
401- { 'field1' :'All- Bikes' , 'level' :1 , 'Uruguay' :68 , 'Uruguay-Lydia' :68 , 'Uruguay-Lydia-01/06/2020' :68 } ,
402- { 'field1' :'All- Accessories' , 'level' :1 , 'USA' :293 , 'USA-David' :293 , 'USA-David-04/07/2021' :293 } ,
403- { 'field1' :'All- Components' , 'level' :1 , 'USA' :240 , 'USA-John' :240 , 'USA-John-12/08/2021' :240 }
401+ { 'field1' :'Bikes' , 'level' :1 , 'Uruguay' :68 , 'Uruguay-Lydia' :68 , 'Uruguay-Lydia-01/06/2020' :68 } ,
402+ { 'field1' :'Accessories' , 'level' :1 , 'USA' :293 , 'USA-David' :293 , 'USA-David-04/07/2021' :293 } ,
403+ { 'field1' :'Components' , 'level' :1 , 'USA' :240 , 'USA-John' :240 , 'USA-John-12/08/2021' :240 }
404404 ] ) ;
405405 } ) ;
406406
@@ -421,25 +421,25 @@ describe('Pivot pipes', () => {
421421 const columnPipeResult = columnPipe . transform ( rowPipeResult , pivotConfigHierarchy . columns , values ) ;
422422 expect ( columnPipeResult ) . toEqual ( [ {
423423 'field1' :'All' , 'records' :[
424- { 'field1' :'All- Clothing' , 'level' :1 , 'All-UnitsSold' :1526 , 'All-Bulgaria-UnitsSold' :774 ,
424+ { 'field1' :'Clothing' , 'level' :1 , 'All-UnitsSold' :1526 , 'All-Bulgaria-UnitsSold' :774 ,
425425 'All-Bulgaria-UnitPrice' :28.86 , 'All-USA-UnitsSold' :296 , 'All-USA-UnitPrice' :49.57 , 'All-Uruguay-UnitsSold' :456 ,
426426 'All-Uruguay-UnitPrice' :68.33 , 'All-UnitPrice' :146.76 } ,
427- { 'field1' :'All- Bikes' , 'level' :1 , 'All-UnitsSold' :68 , 'All-Uruguay-UnitsSold' :68 ,
427+ { 'field1' :'Bikes' , 'level' :1 , 'All-UnitsSold' :68 , 'All-Uruguay-UnitsSold' :68 ,
428428 'All-Uruguay-UnitPrice' :3.56 , 'All-UnitPrice' :3.56 } ,
429- { 'field1' :'All- Accessories' , 'level' :1 , 'All-UnitsSold' :293 , 'All-USA-UnitsSold' :293 ,
429+ { 'field1' :'Accessories' , 'level' :1 , 'All-UnitsSold' :293 , 'All-USA-UnitsSold' :293 ,
430430 'All-USA-UnitPrice' :85.58 , 'All-UnitPrice' :85.58 } ,
431- { 'field1' :'All- Components' , 'level' :1 , 'All-UnitsSold' :240 , 'All-USA-UnitsSold' :240 ,
431+ { 'field1' :'Components' , 'level' :1 , 'All-UnitsSold' :240 , 'All-USA-UnitsSold' :240 ,
432432 'All-USA-UnitPrice' :18.13 , 'All-UnitPrice' :18.13 }
433433 ] , 'level' :0 , 'All-UnitsSold' :2127 , 'All-Bulgaria-UnitsSold' :774 , 'All-Bulgaria-UnitPrice' :28.86 , 'All-USA-UnitsSold' :829 ,
434434 'All-USA-UnitPrice' :153.28 , 'All-Uruguay-UnitsSold' :524 , 'All-Uruguay-UnitPrice' :71.89 , 'All-UnitPrice' :254.02999999999997 } ,
435- { 'field1' :'All- Clothing' , 'level' :1 , 'All-UnitsSold' :1526 , 'All-Bulgaria-UnitsSold' :774 ,
435+ { 'field1' :'Clothing' , 'level' :1 , 'All-UnitsSold' :1526 , 'All-Bulgaria-UnitsSold' :774 ,
436436 'All-Bulgaria-UnitPrice' :28.86 , 'All-USA-UnitsSold' :296 , 'All-USA-UnitPrice' :49.57 , 'All-Uruguay-UnitsSold' :456 ,
437437 'All-Uruguay-UnitPrice' :68.33 , 'All-UnitPrice' :146.76 } ,
438- { 'field1' :'All- Bikes' , 'level' :1 , 'All-UnitsSold' :68 , 'All-Uruguay-UnitsSold' :68 ,
438+ { 'field1' :'Bikes' , 'level' :1 , 'All-UnitsSold' :68 , 'All-Uruguay-UnitsSold' :68 ,
439439 'All-Uruguay-UnitPrice' :3.56 , 'All-UnitPrice' :3.56 } ,
440- { 'field1' :'All- Accessories' , 'level' :1 , 'All-UnitsSold' :293 , 'All-USA-UnitsSold' :293 ,
440+ { 'field1' :'Accessories' , 'level' :1 , 'All-UnitsSold' :293 , 'All-USA-UnitsSold' :293 ,
441441 'All-USA-UnitPrice' :85.58 , 'All-UnitPrice' :85.58 } ,
442- { 'field1' :'All- Components' , 'level' :1 , 'All-UnitsSold' :240 , 'All-USA-UnitsSold' :240 ,
442+ { 'field1' :'Components' , 'level' :1 , 'All-UnitsSold' :240 , 'All-USA-UnitsSold' :240 ,
443443 'All-USA-UnitPrice' :18.13 , 'All-UnitPrice' :18.13 }
444444 ] ) ;
445445 } ) ;
0 commit comments