Skip to content

Commit d86548b

Browse files
committed
add test for image on page1
1 parent 5b7667c commit d86548b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/pages/page1/page1.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<ion-content padding>
1111
<h3>Ionic Menu Starter</h3>
1212

13+
<img src="assets/icon/favicon.ico" alt="" />
14+
1315
<p>
1416
If you get lost, the <a href="http://ionicframework.com/docs/v2">docs</a> will show you the way.
1517
</p>

src/pages/page1/page1.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,10 @@ describe('Page1', () => {
4141
expect(h3.innerText).toMatch(/ionic/i,
4242
'<h3> should say something about "Ionic"');
4343
});
44+
45+
it('should show the favicon as <img>', () => {
46+
fixture.detectChanges();
47+
const img: HTMLImageElement = fixture.debugElement.query(By.css('img')).nativeElement;
48+
expect(img.src).toContain('assets/icon/favicon.ico');
49+
});
4450
});

0 commit comments

Comments
 (0)