Skip to content

Commit 1b475fd

Browse files
authored
Merge branch 'main' into add-default-value-to-display-string
2 parents fd953b3 + 41a3f03 commit 1b475fd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

projects/components/src/menu-dropdown/menu-item/menu-item.component.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}));

projects/components/src/menu-dropdown/menu-item/menu-item.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)