Skip to content

Commit 924357d

Browse files
committed
feat(helloWorld): introduce hello world
Closes #1
1 parent 8da4914 commit 924357d

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

src/app/components/hello/hello.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
h1 {
2+
font-size: 20px;
3+
}
4+
5+
h1 span {
6+
font-weight: normal;
7+
}

src/app/components/hello/hello.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
<p>
2-
hello Works!
3-
</p>
1+
<h1>Hello <span>{{ person }}</span></h1>

src/app/components/hello/hello.spec.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ describe('Hello Component', () => {
1818
beforeEachProviders(() => []);
1919

2020

21-
it('should ...', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => {
22-
return tcb.createAsync(HelloCmp).then((fixture) => {
23-
fixture.detectChanges();
24-
});
21+
it('should have a default `person`', inject([TestComponentBuilder], (tcb:TestComponentBuilder) => {
22+
tcb
23+
.overrideTemplate(HelloCmp, '<h1>Hello {{person}}!</h1>') // TODO: remove this line once angular/angular issue: #5662 is fixed
24+
.createAsync(HelloCmp)
25+
.then((fixture) => {
26+
fixture.detectChanges();
27+
expect(fixture.nativeElement.textContent).toBe('Hello World!');
28+
});
2529
}));
2630

2731
});

src/app/components/hello/hello.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {Component} from 'angular2/core';
1010
pipes: []
1111
})
1212
export class HelloCmp {
13-
14-
constructor() {}
15-
13+
14+
person: string = 'World';
15+
1616
}

0 commit comments

Comments
 (0)