@@ -399,22 +399,27 @@ describe('Test axes', function() {
399399 it ( 'should set categoryorder to default if categoryorder and categoryarray are not supplied' , function ( ) {
400400 PlotlyInternal . plot ( gd , [ { x : [ 'c' , 'a' , 'e' , 'b' , 'd' ] , y : [ 15 , 11 , 12 , 13 , 14 ] } ] , { xaxis : { type : 'category' } } ) ;
401401 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'trace' ) ;
402+ expect ( gd . _fullLayout . xaxis . categorarray ) . toBe ( undefined ) ;
402403 } ) ;
403404
404405 it ( 'should set categoryorder to default even if type is not set to category explicitly' , function ( ) {
405406 PlotlyInternal . plot ( gd , [ { x : [ 'c' , 'a' , 'e' , 'b' , 'd' ] , y : [ 15 , 11 , 12 , 13 , 14 ] } ] ) ;
406407 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'trace' ) ;
408+ expect ( gd . _fullLayout . xaxis . categorarray ) . toBe ( undefined ) ;
407409 } ) ;
408410
409411 it ( 'should NOT set categoryorder to default if type is not category' , function ( ) {
410412 PlotlyInternal . plot ( gd , [ { x : [ 'c' , 'a' , 'e' , 'b' , 'd' ] , y : [ 15 , 11 , 12 , 13 , 14 ] } ] ) ;
411413 expect ( gd . _fullLayout . yaxis . categoryorder ) . toBe ( undefined ) ;
414+ expect ( gd . _fullLayout . xaxis . categorarray ) . toBe ( undefined ) ;
412415 } ) ;
413416
414417 it ( 'should set categoryorder to default if type is overridden to be category' , function ( ) {
415418 PlotlyInternal . plot ( gd , [ { x : [ 1 , 2 , 3 , 4 , 5 ] , y : [ 15 , 11 , 12 , 13 , 14 ] } ] , { yaxis : { type : 'category' } } ) ;
416419 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( undefined ) ;
420+ expect ( gd . _fullLayout . yaxis . categorarray ) . toBe ( undefined ) ;
417421 expect ( gd . _fullLayout . yaxis . categoryorder ) . toBe ( 'trace' ) ;
422+ expect ( gd . _fullLayout . yaxis . categorarray ) . toBe ( undefined ) ;
418423 } ) ;
419424
420425 } ) ;
@@ -426,20 +431,23 @@ describe('Test axes', function() {
426431 xaxis : { type : 'category' , categoryorder : 'array' , categoryarray : [ 'b' , 'a' , 'd' , 'e' , 'c' ] }
427432 } ) ;
428433 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'array' ) ;
434+ expect ( gd . _fullLayout . xaxis . categoryarray ) . toEqual ( [ 'b' , 'a' , 'd' , 'e' , 'c' ] ) ;
429435 } ) ;
430436
431437 it ( 'should switch categoryorder on "array" if it is not supplied but categoryarray is supplied' , function ( ) {
432438 PlotlyInternal . plot ( gd , [ { x : [ 'c' , 'a' , 'e' , 'b' , 'd' ] , y : [ 15 , 11 , 12 , 13 , 14 ] } ] , {
433439 xaxis : { type : 'category' , categoryarray : [ 'b' , 'a' , 'd' , 'e' , 'c' ] }
434440 } ) ;
435441 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'array' ) ;
442+ expect ( gd . _fullLayout . xaxis . categoryarray ) . toEqual ( [ 'b' , 'a' , 'd' , 'e' , 'c' ] ) ;
436443 } ) ;
437444
438445 it ( 'should revert categoryorder to "trace" if "array" is supplied but there is no list' , function ( ) {
439446 PlotlyInternal . plot ( gd , [ { x : [ 'c' , 'a' , 'e' , 'b' , 'd' ] , y : [ 15 , 11 , 12 , 13 , 14 ] } ] , {
440447 xaxis : { type : 'category' , categoryorder : 'array' }
441448 } ) ;
442449 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'trace' ) ;
450+ expect ( gd . _fullLayout . xaxis . categorarray ) . toBe ( undefined ) ;
443451 } ) ;
444452
445453 } ) ;
@@ -451,13 +459,15 @@ describe('Test axes', function() {
451459 xaxis : { type : 'category' , categoryorder : 'array' , categoryarray : [ ] }
452460 } ) ;
453461 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'trace' ) ;
462+ expect ( gd . _fullLayout . xaxis . categoryarray ) . toEqual ( [ ] ) ;
454463 } ) ;
455464
456465 it ( 'should not switch categoryorder on "array" if categoryarray is supplied but empty' , function ( ) {
457466 PlotlyInternal . plot ( gd , [ { x : [ 'c' , 'a' , 'e' , 'b' , 'd' ] , y : [ 15 , 11 , 12 , 13 , 14 ] } ] , {
458467 xaxis : { type : 'category' , categoryarray : [ ] }
459468 } ) ;
460469 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'trace' ) ;
470+ expect ( gd . _fullLayout . xaxis . categoryarray ) . toEqual ( undefined ) ;
461471 } ) ;
462472 } ) ;
463473
@@ -468,20 +478,23 @@ describe('Test axes', function() {
468478 xaxis : { type : 'category' , categoryorder : 'trace' , categoryarray : [ 'b' , 'a' , 'd' , 'e' , 'c' ] }
469479 } ) ;
470480 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'trace' ) ;
481+ expect ( gd . _fullLayout . xaxis . categoryarray ) . toBe ( undefined ) ;
471482 } ) ;
472483
473484 it ( 'should use specified categoryorder if it is supplied even if categoryarray exists' , function ( ) {
474485 PlotlyInternal . plot ( gd , [ { x : [ 'c' , 'a' , 'e' , 'b' , 'd' ] , y : [ 15 , 11 , 12 , 13 , 14 ] } ] , {
475486 xaxis : { type : 'category' , categoryorder : 'category ascending' , categoryarray : [ 'b' , 'a' , 'd' , 'e' , 'c' ] }
476487 } ) ;
477488 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'category ascending' ) ;
489+ expect ( gd . _fullLayout . xaxis . categoryarray ) . toBe ( undefined ) ;
478490 } ) ;
479491
480492 it ( 'should use specified categoryorder if it is supplied even if categoryarray exists' , function ( ) {
481493 PlotlyInternal . plot ( gd , [ { x : [ 'c' , 'a' , 'e' , 'b' , 'd' ] , y : [ 15 , 11 , 12 , 13 , 14 ] } ] , {
482494 xaxis : { type : 'category' , categoryorder : 'category descending' , categoryarray : [ 'b' , 'a' , 'd' , 'e' , 'c' ] }
483495 } ) ;
484496 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'category descending' ) ;
497+ expect ( gd . _fullLayout . xaxis . categoryarray ) . toBe ( undefined ) ;
485498 } ) ;
486499
487500 } ) ;
@@ -493,13 +506,15 @@ describe('Test axes', function() {
493506 xaxis : { type : 'category' , categoryorder : 'invalid value' }
494507 } ) ;
495508 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'trace' ) ;
509+ expect ( gd . _fullLayout . xaxis . categoryarray ) . toBe ( undefined ) ;
496510 } ) ;
497511
498512 it ( 'should switch categoryorder to "array" if mode is supplied but invalid and list is supplied' , function ( ) {
499513 PlotlyInternal . plot ( gd , [ { x : [ 'c' , 'a' , 'e' , 'b' , 'd' ] , y : [ 15 , 11 , 12 , 13 , 14 ] } ] , {
500514 xaxis : { type : 'category' , categoryorder : 'invalid value' , categoryarray : [ 'b' , 'a' , 'd' , 'e' , 'c' ] }
501515 } ) ;
502516 expect ( gd . _fullLayout . xaxis . categoryorder ) . toBe ( 'array' ) ;
517+ expect ( gd . _fullLayout . xaxis . categoryarray ) . toEqual ( [ 'b' , 'a' , 'd' , 'e' , 'c' ] ) ;
503518 } ) ;
504519
505520 } ) ;
0 commit comments