@@ -462,6 +462,46 @@ module powerbi.extensibility.visual.test {
462
462
} ) ;
463
463
} ) ;
464
464
465
+ describe ( "Task Settings" , ( ) => {
466
+ it ( "color" , ( done ) => {
467
+ dataView = defaultDataViewBuilder . getDataView ( [
468
+ GanttData . ColumnTask ,
469
+ GanttData . ColumnStartDate ,
470
+ GanttData . ColumnDuration ,
471
+ GanttData . ColumnResource ] ) ;
472
+
473
+ let color : string = GanttBuilder . getRandomHexColor ( ) ;
474
+ dataView . metadata . objects = {
475
+ taskConfig : {
476
+ fill : GanttBuilder . getSolidColorStructuralObject ( color )
477
+ }
478
+ } ;
479
+
480
+ visualBuilder . updateRenderTimeout ( dataView , ( ) => {
481
+ visualBuilder . taskRect . toArray ( ) . map ( $ ) . forEach ( e =>
482
+ assertColorsMatch ( e . css ( "fill" ) , color ) ) ;
483
+
484
+ done ( ) ;
485
+ } ) ;
486
+ } ) ;
487
+
488
+ it ( "height" , ( done ) => {
489
+ let height : number = 50 ;
490
+ dataView . metadata . objects = {
491
+ taskConfig : {
492
+ height
493
+ }
494
+ } ;
495
+
496
+ visualBuilder . updateRenderTimeout ( dataView , ( ) => {
497
+ visualBuilder . taskRect . toArray ( ) . map ( $ ) . forEach ( e =>
498
+ expect ( + e . attr ( "height" ) ) . toEqual ( height ) ) ;
499
+
500
+ done ( ) ;
501
+ } ) ;
502
+ } ) ;
503
+ } ) ;
504
+
465
505
describe ( "Category Labels" , ( ) => {
466
506
beforeEach ( ( ) => {
467
507
dataView . metadata . objects = {
@@ -554,6 +594,54 @@ module powerbi.extensibility.visual.test {
554
594
} ) ;
555
595
} ) ;
556
596
} ) ;
597
+
598
+ describe ( "Gantt date types" , ( ) => {
599
+ it ( "Today color" , ( done ) => {
600
+ let color : string = GanttBuilder . getRandomHexColor ( ) ;
601
+ dataView . metadata . objects = {
602
+ dateType : {
603
+ todayColor : GanttBuilder . getSolidColorStructuralObject ( color )
604
+ }
605
+ } ;
606
+
607
+ checkColor ( visualBuilder . chartLine , color , "stroke" , done ) ;
608
+ } ) ;
609
+
610
+ it ( "Axis color" , ( done ) => {
611
+ let color : string = GanttBuilder . getRandomHexColor ( ) ;
612
+ dataView . metadata . objects = {
613
+ dateType : {
614
+ axisColor : GanttBuilder . getSolidColorStructuralObject ( color )
615
+ }
616
+ } ;
617
+
618
+ checkColor ( visualBuilder . axisTicksLine , color , "stroke" , done ) ;
619
+ } ) ;
620
+
621
+ it ( "Axis taxt color" , ( done ) => {
622
+ let color : string = GanttBuilder . getRandomHexColor ( ) ;
623
+ dataView . metadata . objects = {
624
+ dateType : {
625
+ axisTextColor : GanttBuilder . getSolidColorStructuralObject ( color )
626
+ }
627
+ } ;
628
+
629
+ checkColor ( visualBuilder . axisTicksText , color , "fill" , done ) ;
630
+ } ) ;
631
+
632
+ function checkColor (
633
+ elements : Element [ ] ,
634
+ color : string ,
635
+ cssStyle : string ,
636
+ done : ( ) => void ) : void {
637
+ visualBuilder . updateRenderTimeout ( dataView , ( ) => {
638
+ elements . toArray ( ) . map ( $ ) . forEach ( e =>
639
+ assertColorsMatch ( e . css ( cssStyle ) , color ) ) ;
640
+
641
+ done ( ) ;
642
+ } ) ;
643
+ }
644
+ } ) ;
557
645
} ) ;
558
646
559
647
describe ( "View Model tests" , ( ) => {
0 commit comments