Skip to content

Commit

Permalink
fix(icon): fix NULL content render in MS Edge (#2043)
Browse files Browse the repository at this point in the history
  • Loading branch information
denStrigo authored and yggg committed Oct 31, 2019
1 parent a15c81d commit f37223a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/framework/theme/components/icon/icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class NbIconComponent implements NbIconConfig, OnChanges, OnInit {
protected prevClasses = [];

@HostBinding('innerHtml')
html: SafeHtml;
html: SafeHtml = '';

@HostBinding('class.status-primary')
get primary() {
Expand Down
8 changes: 8 additions & 0 deletions src/framework/theme/components/icon/icon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,12 @@ describe('NbIconComponent', () => {
iconComponent.config = null;
expect(iconComponent.config).toEqual(config);
});

it('icon inner html not to be null or undefined', () => {
const iconComponent: NbIconComponent = TestBed.createComponent(NbIconComponent).componentInstance;
iconComponent.config = { icon: 'test-not-existing-icon' };

expect(iconComponent.html).not.toBeNull();
expect(iconComponent.html).not.toBeUndefined();
});
});

0 comments on commit f37223a

Please sign in to comment.