File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,15 @@ describe('Menu Item Component', () => {
1616
1717 test ( 'should display icon and label as expected' , fakeAsync ( ( ) => {
1818 const spectator = createHost (
19- '<ht-menu-item [icon]="icon" [label]="label" [iconColor]="iconColor"></ht-menu-item>' ,
19+ '<ht-menu-item [icon]="icon" [label]="label" [labelColor]="labelColor" [ iconColor]="iconColor"></ht-menu-item>' ,
2020 {
21- hostProps : { icon : IconType . MoreHorizontal , label : 'Item' , iconColor : Color . Gray1 }
21+ hostProps : { icon : IconType . MoreHorizontal , label : 'Item' , labelColor : Color . Gray1 , iconColor : Color . Gray1 }
2222 }
2323 ) ;
2424 expect ( spectator . query ( '.menu-item' ) ) . toExist ( ) ;
2525 expect ( spectator . query ( '.icon' ) ) . toExist ( ) ;
2626 expect ( spectator . query ( '.label' ) ) . toHaveText ( 'Item' ) ;
27+ expect ( ( spectator . query ( '.label' ) as HTMLSpanElement ) ?. style . color ) . toEqual ( 'rgb(244, 245, 245)' ) ;
2728 expect ( spectator . query ( IconComponent ) ?. icon ) . toBe ( IconType . MoreHorizontal ) ;
2829 expect ( spectator . query ( IconComponent ) ?. color ) . toBe ( Color . Gray1 ) ;
2930 } ) ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import { IconSize } from '../../icon/icon-size';
1515 size="${ IconSize . Small } "
1616 [color]="this.iconColor"
1717 ></ht-icon>
18- <span class="label">{{ this.label }}</span>
18+ <span class="label" [ngStyle]="{ color: this.labelColor ? this.labelColor : '' }" >{{ this.label }}</span>
1919 </div></ht-event-blocker
2020 >`
2121} )
@@ -29,6 +29,9 @@ export class MenuItemComponent {
2929 @Input ( )
3030 public iconColor ?: string ;
3131
32+ @Input ( )
33+ public labelColor ?: string ;
34+
3235 @Input ( )
3336 public disabled ?: boolean ;
3437
You can’t perform that action at this time.
0 commit comments