Skip to content

Commit 0d25d8e

Browse files
authored
test(card): add test for icon font-family in card content (#15134)
1 parent 0cbdaae commit 0d25d8e

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

projects/igniteui-angular/src/lib/card/card.spec.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ describe('Card', () => {
6868
InitCardComponent,
6969
InitOutlinedCardComponent,
7070
CardWithHeaderComponent,
71+
CardContentIconComponent,
7172
VerticalCardComponent,
7273
HorizontalCardComponent
7374
]
@@ -182,6 +183,16 @@ describe('Card', () => {
182183
expect(actions).not.toHaveClass(classes.actions.vertical);
183184
});
184185

186+
it('Should use Material Icons font-family for igx-icon in card content', () => {
187+
const fixture = TestBed.createComponent(CardContentIconComponent);
188+
fixture.detectChanges();
189+
190+
const iconElement = fixture.debugElement.query(By.css('igx-icon')).nativeElement;
191+
const computedStyle = window.getComputedStyle(iconElement);
192+
193+
expect(computedStyle.fontFamily).toBe('"Material Icons"');
194+
});
195+
185196
it('Should automatically align actions vertically when in horizontal layout', () => {
186197
const fixture = TestBed.createComponent(HorizontalCardComponent);
187198
fixture.detectChanges();
@@ -249,6 +260,17 @@ class InitOutlinedCardComponent {
249260
})
250261
class CardWithHeaderComponent { }
251262

263+
@Component({
264+
template: `<igx-card class="ig-typography">
265+
<igx-card-content>
266+
<igx-icon>face</igx-icon>
267+
</igx-card-content>
268+
<igx-card>`,
269+
standalone: true,
270+
imports: [IgxCardComponent, IgxCardContentDirective, IgxIconComponent]
271+
})
272+
class CardContentIconComponent { }
273+
252274
@Component({
253275
template: `<igx-card>
254276
<igx-card-media width="200px" height="50%">

projects/igniteui-angular/src/lib/core/styles/components/card/_card-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@
450450
}
451451
}
452452

453-
%igx-card-content > * {
453+
%igx-card-content > *:not(igx-icon) {
454454
@include type-style($content) {
455455
margin: 0;
456456
}

0 commit comments

Comments
 (0)