forked from primer/octicons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from opf/fix/outerhtml
fix: don't use outerHTML, add specs to Angular package
- Loading branch information
Showing
6 changed files
with
80 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@openproject/octicons': patch | ||
--- | ||
|
||
fix: don't use outerHTML, add specs to Angular package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; | ||
import { | ||
OpPlusIcon, | ||
OpOpAddIcon, | ||
} from './public-api'; | ||
|
||
describe('Github native icon', () => { | ||
let component: OpPlusIcon; | ||
let fixture: ComponentFixture<OpPlusIcon>; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({imports: [OpPlusIcon]}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(OpPlusIcon); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('OpenProject extension icon', () => { | ||
let component: OpOpAddIcon; | ||
let fixture: ComponentFixture<OpOpAddIcon>; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({imports: [OpOpAddIcon]}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(OpOpAddIcon); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeDefined(); | ||
}); | ||
|
||
it('should render the svg', () => { | ||
const iconElement: HTMLElement = fixture.nativeElement; | ||
expect(iconElement.children[0].tagName.toLowerCase()).toEqual("path"); | ||
}); | ||
|
||
it('should render the title', () => { | ||
const iconElement: HTMLElement = fixture.nativeElement; | ||
expect(iconElement.children[0].tagName.toLowerCase()).toEqual("path"); | ||
|
||
component.title = "Some title"; | ||
fixture.detectChanges(); | ||
|
||
expect(iconElement.children[0].tagName.toLowerCase()).toEqual("title"); | ||
expect(iconElement.children[1].tagName.toLowerCase()).toEqual("path"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters