@@ -261,7 +261,6 @@ describe('groupby', function() {
261
261
} ) ;
262
262
} ) ;
263
263
264
- // passes; maybe not for the good reasons (see fixme comments)
265
264
it ( 'Plotly.plot should plot the transform traces' , function ( done ) {
266
265
var data = Lib . extendDeep ( [ ] , mockData0 ) ;
267
266
@@ -285,7 +284,6 @@ describe('groupby', function() {
285
284
} ) ;
286
285
} ) ;
287
286
288
- // passes; looks OK
289
287
it ( 'Plotly.plot should plot the transform traces' , function ( done ) {
290
288
var data = Lib . extendDeep ( [ ] , mockData1 ) ;
291
289
@@ -306,7 +304,6 @@ describe('groupby', function() {
306
304
} ) ;
307
305
} ) ;
308
306
309
- // passes OK; see todo comments
310
307
it ( 'Plotly.plot should plot the transform traces' , function ( done ) {
311
308
var data = Lib . extendDeep ( [ ] , mockData2 ) ;
312
309
@@ -317,18 +314,17 @@ describe('groupby', function() {
317
314
expect ( gd . data [ 0 ] . x ) . toEqual ( [ 1 , - 1 , - 2 , 0 , 1 , 2 , 3 ] ) ;
318
315
expect ( gd . data [ 0 ] . y ) . toEqual ( [ 1 , 2 , 3 , 1 , 2 , 3 , 1 ] ) ;
319
316
320
- expect ( gd . _fullData . length ) . toEqual ( 1 ) ; // todo: confirm this result is OK
317
+ expect ( gd . _fullData . length ) . toEqual ( 1 ) ;
321
318
322
319
expect ( gd . _fullData [ 0 ] . x ) . toEqual ( [ 1 , - 1 , - 2 , 0 , 1 , 2 , 3 ] ) ;
323
320
expect ( gd . _fullData [ 0 ] . y ) . toEqual ( [ 1 , 2 , 3 , 1 , 2 , 3 , 1 ] ) ;
324
321
325
- assertDims ( [ 7 ] ) ; // todo: confirm this result is OK
322
+ assertDims ( [ 7 ] ) ;
326
323
327
324
done ( ) ;
328
325
} ) ;
329
326
} ) ;
330
327
331
- // passes OK; see todo comments
332
328
it ( 'Plotly.plot should plot the transform traces' , function ( done ) {
333
329
var data = Lib . extendDeep ( [ ] , mockData3 ) ;
334
330
@@ -339,12 +335,12 @@ describe('groupby', function() {
339
335
expect ( gd . data [ 0 ] . x ) . toEqual ( [ 1 , - 1 , - 2 , 0 , 1 , 2 , 3 ] ) ;
340
336
expect ( gd . data [ 0 ] . y ) . toEqual ( [ 1 , 2 , 3 , 1 , 2 , 3 , 1 ] ) ;
341
337
342
- expect ( gd . _fullData . length ) . toEqual ( 1 ) ; // todo: confirm this result is OK
338
+ expect ( gd . _fullData . length ) . toEqual ( 1 ) ;
343
339
344
340
expect ( gd . _fullData [ 0 ] . x ) . toEqual ( [ 1 , - 1 , - 2 , 0 , 1 , 2 , 3 ] ) ;
345
341
expect ( gd . _fullData [ 0 ] . y ) . toEqual ( [ 1 , 2 , 3 , 1 , 2 , 3 , 1 ] ) ;
346
342
347
- assertDims ( [ 7 ] ) ; // todo: confirm this result is OK
343
+ assertDims ( [ 7 ] ) ;
348
344
349
345
done ( ) ;
350
346
} ) ;
@@ -354,7 +350,7 @@ describe('groupby', function() {
354
350
describe ( 'grouping with basic, heterogenous and overridden attributes' , function ( ) {
355
351
'use strict' ;
356
352
357
- afterEach ( destroyGraphDiv ) ;
353
+ // afterEach(destroyGraphDiv);
358
354
359
355
function test ( mockData ) {
360
356
@@ -453,8 +449,7 @@ describe('groupby', function() {
453
449
color : 'darkred' , // general 'default' color
454
450
line : {
455
451
width : [ 4 , 2 , 4 , 2 , 2 , 3 , 3 ] ,
456
- // a general, not overridden array will be interpreted per group
457
- color : [ 'orange' , 'red' , 'green' , 'cyan' ]
452
+ color : [ 'orange' , 'red' , 'green' , 'cyan' , 'magenta' , 'blue' , 'pink' ]
458
453
}
459
454
} ,
460
455
line : { color : 'red' } ,
@@ -464,7 +459,7 @@ describe('groupby', function() {
464
459
style : {
465
460
a : { marker : { size : 30 } } ,
466
461
// override general color:
467
- b : { marker : { size : 15 , color : 'lightblue' } , line : { color : 'purple' } }
462
+ b : { marker : { size : 15 , line : { color : 'yellow' } } , line : { color : 'purple' } }
468
463
}
469
464
} ]
470
465
} ] ;
@@ -512,10 +507,17 @@ describe('groupby', function() {
512
507
} ] ;
513
508
514
509
it ( '`data` preserves user supplied input but `gd._fullData` reflects the grouping' , test ( mockData1 ) ) ;
510
+
515
511
it ( 'passes with lots of attributes and heterogenous attrib presence' , test ( mockData2 ) ) ;
512
+
516
513
it ( 'passes with group styles partially overriding top level aesthetics' , test ( mockData3 ) ) ;
514
+ expect ( gd . _fullData [ 0 ] . marker . line . color ) . toEqual ( [ 'orange' , 'red' , 'cyan' , 'pink' ] ) ;
515
+ expect ( gd . _fullData [ 1 ] . marker . line . color ) . toEqual ( 'yellow' ) ;
516
+
517
517
it ( 'passes with no explicit styling for the individual group' , test ( mockData4 ) ) ;
518
+
518
519
it ( 'passes with no explicit styling in the group transform at all' , test ( mockData5 ) ) ;
520
+
519
521
it ( 'passes with no explicit styling in the group transform at all' , test ( mockData6 ) ) ;
520
522
521
523
} ) ;
0 commit comments