File tree Expand file tree Collapse file tree 5 files changed +42
-9
lines changed
Expand file tree Collapse file tree 5 files changed +42
-9
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ describe('GettingStartedComponent', () => {
3535 const { app, fixture } = setup ( ) ;
3636 fixture . detectChanges ( ) ;
3737 const compile = fixture . debugElement . nativeElement ;
38- const h1tag = compile . querySelector ( 'p' ) ;
39- expect ( h1tag . textContent ) . toBe ( 'getting-started works!' ) ;
38+ const ptag = compile . querySelector ( 'p' ) ;
39+ expect ( ptag . textContent ) . toBe ( 'getting-started works!' ) ;
4040 } ) ) ;
4141
4242
Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ describe('ReportsComponent', () => {
66 let component : ReportsComponent ;
77 let fixture : ComponentFixture < ReportsComponent > ;
88
9+ function setup ( ) {
10+ // tslint:disable-next-line: no-shadowed-variable
11+ const fixture = TestBed . createComponent ( ReportsComponent ) ;
12+ const app = fixture . debugElement . componentInstance ;
13+ return { fixture, app } ;
14+ }
15+
916 beforeEach ( async ( ( ) => {
1017 TestBed . configureTestingModule ( {
1118 declarations : [ ReportsComponent ]
@@ -19,7 +26,17 @@ describe('ReportsComponent', () => {
1926 fixture . detectChanges ( ) ;
2027 } ) ;
2128
22- it ( 'should create ' , ( ) => {
29+ it ( 'should be created ' , ( ) => {
2330 expect ( component ) . toBeTruthy ( ) ;
2431 } ) ;
25- } ) ;
32+
33+ it ( 'should have p tag as \'reports works!\'' , async ( ( ) => {
34+ // tslint:disable-next-line: no-shadowed-variable
35+ const { app, fixture } = setup ( ) ;
36+ fixture . detectChanges ( ) ;
37+ const compile = fixture . debugElement . nativeElement ;
38+ const ptag = compile . querySelector ( 'p' ) ;
39+ expect ( ptag . textContent ) . toBe ( 'reports works!' ) ;
40+ } ) ) ;
41+
42+ } ) ;
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ describe('TimeClockComponent', () => {
3535 const { app, fixture } = setup ( ) ;
3636 fixture . detectChanges ( ) ;
3737 const compile = fixture . debugElement . nativeElement ;
38- const h1tag = compile . querySelector ( 'p' ) ;
39- expect ( h1tag . textContent ) . toBe ( 'time-clock works!' ) ;
38+ const ptag = compile . querySelector ( 'p' ) ;
39+ expect ( ptag . textContent ) . toBe ( 'time-clock works!' ) ;
4040 } ) ) ;
4141
4242} ) ;
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ describe('TimeEntriesComponent', () => {
3535 const { app, fixture } = setup ( ) ;
3636 fixture . detectChanges ( ) ;
3737 const compile = fixture . debugElement . nativeElement ;
38- const h1tag = compile . querySelector ( 'p' ) ;
39- expect ( h1tag . textContent ) . toBe ( 'time-entries works!' ) ;
38+ const ptag = compile . querySelector ( 'p' ) ;
39+ expect ( ptag . textContent ) . toBe ( 'time-entries works!' ) ;
4040 } ) ) ;
4141
4242} ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ describe('TimeOffComponent', () => {
66 let component : TimeOffComponent ;
77 let fixture : ComponentFixture < TimeOffComponent > ;
88
9+ function setup ( ) {
10+ // tslint:disable-next-line: no-shadowed-variable
11+ const fixture = TestBed . createComponent ( TimeOffComponent ) ;
12+ const app = fixture . debugElement . componentInstance ;
13+ return { fixture, app } ;
14+ }
15+
916 beforeEach ( async ( ( ) => {
1017 TestBed . configureTestingModule ( {
1118 declarations : [ TimeOffComponent ]
@@ -19,7 +26,16 @@ describe('TimeOffComponent', () => {
1926 fixture . detectChanges ( ) ;
2027 } ) ;
2128
22- it ( 'should create ' , ( ) => {
29+ it ( 'should be created ' , ( ) => {
2330 expect ( component ) . toBeTruthy ( ) ;
2431 } ) ;
32+
33+ it ( 'should have p tag as \'time-off works!\'' , async ( ( ) => {
34+ // tslint:disable-next-line: no-shadowed-variable
35+ const { app, fixture } = setup ( ) ;
36+ fixture . detectChanges ( ) ;
37+ const compile = fixture . debugElement . nativeElement ;
38+ const ptag = compile . querySelector ( 'p' ) ;
39+ expect ( ptag . textContent ) . toBe ( 'time-off works!' ) ;
40+ } ) ) ;
2541} ) ;
You can’t perform that action at this time.
0 commit comments