Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit f5614e8

Browse files
Foxandxsswardbell
authored andcommitted
docs(style-guide): add more tests
closes #1532
1 parent c2c6096 commit f5614e8

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

public/docs/_examples/style-guide/e2e-spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ describe('Style Guide', function () {
5858
it('03-05', function () {
5959
browser.get('#/03-05');
6060

61+
var div = element(by.tagName('sg-app > div'));
62+
expect(div.getText()).toBe('Actual favorite: Windstorm');
63+
6164
var lis = element.all(by.tagName('sg-app > ul > li'));
6265
expect(lis.get(0).getText()).toBe('Windstorm');
6366
expect(lis.get(1).getText()).toBe('Bombasto');
@@ -68,6 +71,9 @@ describe('Style Guide', function () {
6871
it('03-06', function () {
6972
browser.get('#/03-06');
7073

74+
var div = element(by.tagName('sg-app > div'));
75+
expect(div.getText()).toBe('Actual favorite: Windstorm');
76+
7177
var lis = element.all(by.tagName('sg-app > ul > li'));
7278
expect(lis.get(0).getText()).toBe('Windstorm');
7379
expect(lis.get(1).getText()).toBe('Bombasto');

public/docs/_examples/style-guide/ts/03-05/app/app.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<div>Actual favorite: {{favorite?.name}}</div>
12
<ul>
23
<li *ngFor="let hero of heroes">
34
{{hero.name}}

public/docs/_examples/style-guide/ts/03-05/app/app.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ import { Hero } from './+heroes/shared/hero.model';
1111
providers: [HeroService, ExceptionService, SpinnerService, ToastService]
1212
})
1313
export class AppComponent implements OnInit {
14+
favorite: Hero;
1415
heroes: Hero[];
1516

1617
constructor(private heroService: HeroService) { }
1718

1819
ngOnInit() {
20+
this.heroService.getHero(1).subscribe(hero => this.favorite = hero);
1921
this.heroService.getHeroes().subscribe(heroes => this.heroes = heroes);
2022
}
2123
}

public/docs/_examples/style-guide/ts/03-06/app/app.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<div>Actual favorite: {{favorite?.name}}</div>
12
<ul>
23
<li *ngFor="let hero of heroes">
34
{{hero.name}}

public/docs/_examples/style-guide/ts/03-06/app/app.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ import { Hero } from './+heroes/shared/hero.model';
1111
providers: [HeroService, ExceptionService, SpinnerService, ToastService]
1212
})
1313
export class AppComponent implements OnInit {
14+
favorite: Hero;
1415
heroes: Hero[];
1516

1617
constructor(private heroService: HeroService) { }
1718

1819
ngOnInit() {
20+
this.heroService.getHero(1).subscribe(hero => this.favorite = hero);
1921
this.heroService.getHeroes().subscribe(heroes => this.heroes = heroes);
2022
}
2123
}

public/docs/_examples/style-guide/ts/app/hero-data.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export class HeroData {
22
createDb() {
33
let heroes = [
4-
{ id: '1', name: 'Windstorm' },
5-
{ id: '2', name: 'Bombasto' },
6-
{ id: '3', name: 'Magneta' },
7-
{ id: '4', name: 'Tornado' }
4+
{ id: 1, name: 'Windstorm' },
5+
{ id: 2, name: 'Bombasto' },
6+
{ id: 3, name: 'Magneta' },
7+
{ id: 4, name: 'Tornado' }
88
];
99
return {heroes};
1010
}

0 commit comments

Comments
 (0)