Skip to content

Commit 8f4266a

Browse files
Resolved automatic test issue.
1 parent 644fff1 commit 8f4266a

File tree

11 files changed

+121
-71
lines changed

11 files changed

+121
-71
lines changed

client/src/app/dashboard/crawler/crawler.component.spec.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,28 @@
1717
*/
1818

1919
import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing';
20-
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
21-
import { HttpClientModule } from '@angular/common/http';
2220
import { BrowserAnimationsModule} from '@angular/platform-browser/animations';
23-
import { MatTableModule, MatInputModule, MatPaginatorModule} from '@angular/material';
24-
import { MatFormFieldModule} from '@angular/material/form-field';
25-
import { MatCheckboxModule} from '@angular/material/checkbox';
26-
import { MatIconModule} from '@angular/material/icon';
27-
import { MatDialogModule} from '@angular/material/dialog';
28-
import { TableAllComponent } from '../table-all/table-all.component';
2921
import { CrawlerComponent } from './crawler.component';
30-
import { ModelService } from 'src/app/model/model.service';
31-
3222

3323
describe('CrawlerComponent', () => {
3424
let fixture: ComponentFixture<CrawlerComponent>;
25+
let component: CrawlerComponent;
3526

3627
beforeEach(async(() => {
3728
TestBed.configureTestingModule({
38-
declarations: [ CrawlerComponent, TableAllComponent],
39-
imports: [HttpClientTestingModule, HttpClientModule, BrowserAnimationsModule,
40-
MatTableModule, MatInputModule, MatFormFieldModule, MatCheckboxModule, MatPaginatorModule, MatIconModule, MatDialogModule]
29+
declarations: [ CrawlerComponent],
30+
imports: [BrowserAnimationsModule]
4131
})
4232
.compileComponents();
4333
}));
4434

4535
beforeEach(() => {
4636
fixture = TestBed.createComponent(CrawlerComponent);
37+
component = fixture.componentInstance;
4738
fixture.detectChanges();
4839
});
4940

50-
it(`should create`, async(inject([HttpTestingController, ModelService],
51-
(modelService: ModelService) => {
52-
expect(modelService).toBeTruthy();
53-
})));
41+
it('should create', () => {
42+
expect(component).toBeTruthy();
43+
});
5444
});

client/src/app/dashboard/dashboard-overview/dashboard-overview.component.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { RouterTestingModule } from '@angular/router/testing';
2222
import { StatusCardComponent } from '../status-card/status-card.component';
2323
import { DashboardCardComponent } from '../dashboard-card/dashboard-card.component';
2424
import { RouterModule } from '@angular/router';
25+
import { MaterialModule } from '../../material-module/material.module';
26+
import { InforCenterComponent } from '../infor-center/infor-center.component';
2527
import { DashboardOverviewComponent } from './dashboard-overview.component';
2628

2729
describe('DashboardOverviewComponent', () => {
@@ -30,8 +32,8 @@ describe('DashboardOverviewComponent', () => {
3032

3133
beforeEach(async(() => {
3234
TestBed.configureTestingModule({
33-
declarations: [ DashboardOverviewComponent, DashboardCardComponent, StatusCardComponent ],
34-
imports: [RouterModule, HttpClientModule, RouterTestingModule]
35+
declarations: [ DashboardOverviewComponent, DashboardCardComponent, StatusCardComponent, InforCenterComponent],
36+
imports: [RouterModule, HttpClientModule, RouterTestingModule, MaterialModule]
3537
})
3638
.compileComponents();
3739
}));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1+
<!--/*
2+
* Copyright (C) 2018 The Delphi Team.
3+
* See the LICENCE file distributed with this work for additional
4+
* information regarding copyright ownership.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/-->
18+
119
<h4>Information Center</h4>
220
<div [ngClass]="'infoCenter'">Information Center data goes here!!</div>
Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
1-
import { InfoCenter } from '../../model/models/instance';
1+
/*
2+
* Copyright (C) 2018 The Delphi Team.
3+
* See the LICENCE file distributed with this work for additional
4+
* information regarding copyright ownership.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
218
import { Component, OnInit, Input, ViewChild } from '@angular/core';
319
import { MatTableDataSource } from '@angular/material';
420

5-
6-
721
@Component({
822
selector: 'app-infor-center',
923
templateUrl: './infor-center.component.html',
1024
styleUrls: ['./infor-center.component.css']
1125
})
1226

13-
14-
1527
export class InforCenterComponent implements OnInit {
1628

1729
constructor() {
1830
}
1931

2032
ngOnInit() {
21-
22-
23-
2433
}
2534

2635
}

client/src/app/dashboard/instance-details/instance-details.component.html

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
<!--
2+
/*
3+
* Copyright (C) 2018 The Delphi Team.
4+
* See the LICENCE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/ -->
19+
120
<div class="container-fluid">
221
<div class="row">
322
<h4 [ngClass]="'titleAlign'">Title</h4>
@@ -12,31 +31,31 @@ <h4>Instance Details</h4>
1231
<p>Name:</p>
1332
</mat-grid-tile>
1433
<mat-grid-tile>
15-
<p><b></b></p>
34+
<p><b>Instance name goes here!!</b></p>
1635
</mat-grid-tile>
1736
<mat-grid-tile>
1837
<p>Host:</p>
1938
</mat-grid-tile>
2039
<mat-grid-tile>
21-
<p><b></b></p>
40+
<p><b>Host name goes here!!</b></p>
2241
</mat-grid-tile>
2342
<mat-grid-tile>
2443
<p>Port Number:</p>
2544
</mat-grid-tile>
2645
<mat-grid-tile>
27-
<p><b></b></p>
46+
<p><b>Port number goes here!!</b></p>
2847
</mat-grid-tile>
2948
<mat-grid-tile>
3049
<p>DockerId:</p>
3150
</mat-grid-tile>
3251
<mat-grid-tile>
33-
<p><b></b></p>
52+
<p><b>Docker Id goes here!!</b></p>
3453
</mat-grid-tile>
3554
<mat-grid-tile>
3655
<p>Labels:</p>
3756
</mat-grid-tile>
3857
<mat-grid-tile>
39-
<p><b></b></p>
58+
<p><b>Labels goes here!!</b></p>
4059
</mat-grid-tile>
4160
</mat-grid-list>
4261
</div>

client/src/app/dashboard/instance-details/instance-details.component.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2-
2+
import { BrowserAnimationsModule} from '@angular/platform-browser/animations';
3+
import { MaterialModule } from '../../material-module/material.module';
34
import { InstanceDetailsComponent } from './instance-details.component';
45

56
describe('InstanceDetailsComponent', () => {
@@ -8,7 +9,8 @@ describe('InstanceDetailsComponent', () => {
89

910
beforeEach(async(() => {
1011
TestBed.configureTestingModule({
11-
declarations: [ InstanceDetailsComponent ]
12+
declarations: [ InstanceDetailsComponent ],
13+
imports: [BrowserAnimationsModule, MaterialModule]
1214
})
1315
.compileComponents();
1416
}));

client/src/app/dashboard/instance-details/instance-details.component.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright (C) 2018 The Delphi Team.
3+
* See the LICENCE file distributed with this work for additional
4+
* information regarding copyright ownership.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
118
import { Component, OnInit, Input, ViewChild } from '@angular/core';
219
import { InstanceDetails } from '../../model/models/instance';
320

client/src/app/dashboard/table-overview/table-overview.component.spec.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,24 @@
1616
* limitations under the License.
1717
*/
1818

19-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
20-
19+
import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing';
20+
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
21+
import { HttpClientModule } from '@angular/common/http';
22+
import { BrowserAnimationsModule} from '@angular/platform-browser/animations';
2123
import { TableOverviewComponent } from './table-overview.component';
24+
import { MaterialModule } from '../../material-module/material.module';
25+
import { TableAllComponent } from '../table-all/table-all.component';
26+
import { ModelService } from 'src/app/model/model.service';
2227

2328
describe('TableOverviewComponent', () => {
2429
let component: TableOverviewComponent;
2530
let fixture: ComponentFixture<TableOverviewComponent>;
2631

2732
beforeEach(async(() => {
2833
TestBed.configureTestingModule({
29-
declarations: [ TableOverviewComponent ]
34+
declarations: [ TableOverviewComponent, TableAllComponent],
35+
imports: [HttpClientTestingModule, HttpClientModule, BrowserAnimationsModule,
36+
MaterialModule]
3037
})
3138
.compileComponents();
3239
}));
@@ -37,7 +44,8 @@ describe('TableOverviewComponent', () => {
3744
fixture.detectChanges();
3845
});
3946

40-
it('should create', () => {
41-
expect(component).toBeTruthy();
42-
});
47+
it(`should create`, async(inject([HttpTestingController, ModelService],
48+
(modelService: ModelService) => {
49+
expect(modelService).toBeTruthy();
50+
})));
4351
});

client/src/app/dashboard/webapi/web-api.component.spec.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,29 @@
1717
*/
1818

1919
import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing';
20-
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
21-
import { HttpClientModule } from '@angular/common/http';
2220
import { BrowserAnimationsModule} from '@angular/platform-browser/animations';
23-
import { TableAllComponent } from '../table-all/table-all.component';
2421
import { WebApiComponent } from './web-api.component';
25-
import { MaterialModule } from 'src/app/material-module/material.module';
26-
import { ModelService } from 'src/app/model/model.service';
27-
2822

2923
describe('WebApiComponent', () => {
3024
let fixture: ComponentFixture<WebApiComponent>;
25+
let component: WebApiComponent;
3126

3227
beforeEach(async(() => {
3328
TestBed.configureTestingModule({
34-
declarations: [ WebApiComponent, TableAllComponent ],
35-
imports: [HttpClientTestingModule, HttpClientModule, BrowserAnimationsModule,
36-
MaterialModule]
29+
declarations: [ WebApiComponent ],
30+
imports: [BrowserAnimationsModule,
31+
]
3732
})
3833
.compileComponents();
3934
}));
4035

4136
beforeEach(() => {
4237
fixture = TestBed.createComponent(WebApiComponent);
38+
component = fixture.componentInstance;
4339
fixture.detectChanges();
4440
});
4541

46-
it(`should create`, async(inject([HttpTestingController, ModelService],
47-
(modelService: ModelService) => {
48-
expect(modelService).toBeTruthy();
49-
})));
42+
it('should create', () => {
43+
expect(component).toBeTruthy();
44+
});
5045
});

client/src/app/dashboard/webapp/webapp.component.spec.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,30 @@
1717
*/
1818

1919
import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing';
20-
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
21-
import { HttpClientModule } from '@angular/common/http';
2220
import { BrowserAnimationsModule} from '@angular/platform-browser/animations';
23-
import { TableAllComponent } from '../table-all/table-all.component';
2421
import { WebappComponent } from './webapp.component';
25-
import { MaterialModule } from 'src/app/material-module/material.module';
26-
import { ModelService } from 'src/app/model/model.service';
27-
2822

2923
describe('WebappComponent', () => {
3024
let fixture: ComponentFixture<WebappComponent>;
25+
let component: WebappComponent;
26+
3127

3228
beforeEach(async(() => {
3329
TestBed.configureTestingModule({
34-
declarations: [ WebappComponent, TableAllComponent],
35-
imports: [HttpClientTestingModule, HttpClientModule, BrowserAnimationsModule,
36-
MaterialModule]
30+
declarations: [ WebappComponent],
31+
imports: [BrowserAnimationsModule]
3732
})
3833
.compileComponents();
3934
}));
4035

4136
beforeEach(() => {
4237
fixture = TestBed.createComponent(WebappComponent);
38+
component = fixture.componentInstance;
4339
fixture.detectChanges();
4440
});
4541

46-
it(`should create`, async(inject([HttpTestingController, ModelService],
47-
(modelService: ModelService) => {
48-
expect(modelService).toBeTruthy();
42+
it(`should create`, async(inject([],
43+
() => {
44+
expect(component).toBeTruthy();
4945
})));
5046
});

0 commit comments

Comments
 (0)