@@ -2,47 +2,33 @@ import { TestBed, waitForAsync } from '@angular/core/testing';
2
2
import { AppComponent } from '@app/app.component' ;
3
3
4
4
describe ( 'AppComponent' , ( ) => {
5
- beforeEach (
6
- waitForAsync ( ( ) => {
7
- Object . defineProperty ( window , 'APP_VERSION' , { value : `fake version` , writable : false } ) ;
5
+ beforeEach ( waitForAsync ( ( ) => {
6
+ Object . defineProperty ( window , 'APP_VERSION' , { value : `fake version` , writable : false } ) ;
8
7
9
- TestBed . configureTestingModule ( {
10
- declarations : [ AppComponent ] ,
11
- } ) . compileComponents ( ) ;
12
- } )
13
- ) ;
14
- it (
15
- 'should create the app' ,
16
- waitForAsync ( ( ) => {
17
- const fixture = TestBed . createComponent ( AppComponent ) ;
18
- const app = fixture . debugElement . componentInstance ;
19
- expect ( app ) . toBeTruthy ( ) ;
20
- } )
21
- ) ;
22
- it (
23
- `should have as title 'app'` ,
24
- waitForAsync ( ( ) => {
25
- const fixture = TestBed . createComponent ( AppComponent ) ;
26
- const app = fixture . debugElement . componentInstance ;
27
- expect ( app . title ) . toEqual ( 'full-cycle-app' ) ;
28
- } )
29
- ) ;
30
- it (
31
- 'should render title in a h1 tag' ,
32
- waitForAsync ( ( ) => {
33
- const fixture = TestBed . createComponent ( AppComponent ) ;
34
- fixture . detectChanges ( ) ;
35
- const compiled = fixture . debugElement . nativeElement ;
36
- expect ( compiled . querySelector ( 'h1' ) . textContent ) . toContain ( 'Welcome to full-cycle-app!' ) ;
37
- } )
38
- ) ;
39
- it (
40
- 'should render `version` in div with `version` css class' ,
41
- waitForAsync ( ( ) => {
42
- const fixture = TestBed . createComponent ( AppComponent ) ;
43
- fixture . detectChanges ( ) ;
44
- const compiled = fixture . debugElement . nativeElement ;
45
- expect ( compiled . querySelector ( '.version' ) . textContent ) . toContain ( 'fake version' ) ;
46
- } )
47
- ) ;
8
+ TestBed . configureTestingModule ( {
9
+ imports : [ AppComponent ] ,
10
+ } ) . compileComponents ( ) ;
11
+ } ) ) ;
12
+ it ( 'should create the app' , waitForAsync ( ( ) => {
13
+ const fixture = TestBed . createComponent ( AppComponent ) ;
14
+ const app = fixture . debugElement . componentInstance ;
15
+ expect ( app ) . toBeTruthy ( ) ;
16
+ } ) ) ;
17
+ it ( `should have as title 'app'` , waitForAsync ( ( ) => {
18
+ const fixture = TestBed . createComponent ( AppComponent ) ;
19
+ const app = fixture . debugElement . componentInstance ;
20
+ expect ( app . title ) . toEqual ( 'full-cycle-app' ) ;
21
+ } ) ) ;
22
+ it ( 'should render title in a h1 tag' , waitForAsync ( ( ) => {
23
+ const fixture = TestBed . createComponent ( AppComponent ) ;
24
+ fixture . detectChanges ( ) ;
25
+ const compiled = fixture . debugElement . nativeElement ;
26
+ expect ( compiled . querySelector ( 'h1' ) . textContent ) . toContain ( 'Welcome to full-cycle-app!' ) ;
27
+ } ) ) ;
28
+ it ( 'should render `version` in div with `version` css class' , waitForAsync ( ( ) => {
29
+ const fixture = TestBed . createComponent ( AppComponent ) ;
30
+ fixture . detectChanges ( ) ;
31
+ const compiled = fixture . debugElement . nativeElement ;
32
+ expect ( compiled . querySelector ( '.version' ) . textContent ) . toContain ( 'fake version' ) ;
33
+ } ) ) ;
48
34
} ) ;
0 commit comments