Skip to content

Commit 0fe01bc

Browse files
RINO767RINO767
authored andcommitted
updated cloud card tests
1 parent b215e9d commit 0fe01bc

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/app/components/clouds/cloud-card/cloud-card.component.spec.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
22

33
import { CloudCardComponent } from './cloud-card.component';
4-
import {Router, RouterModule} from '@angular/router';
4+
import {ActivatedRoute, Router, RouterModule} from '@angular/router';
5+
import {of} from 'rxjs';
6+
import * as testData from 'testing/test-data';
57

68
describe('CloudCardComponent', () => {
79
let component: CloudCardComponent;
@@ -16,7 +18,13 @@ describe('CloudCardComponent', () => {
1618
RouterModule
1719
],
1820
providers: [
19-
{provide: Router, useValue: router}
21+
{provide: Router, useValue: router},
22+
{
23+
provide: ActivatedRoute,
24+
useValue: {
25+
params: of({id: null})
26+
}
27+
}
2028
]
2129
})
2230
.compileComponents();
@@ -25,10 +33,12 @@ describe('CloudCardComponent', () => {
2533
beforeEach(() => {
2634
fixture = TestBed.createComponent(CloudCardComponent);
2735
component = fixture.componentInstance;
36+
37+
component.cloud = testData.cloudOne;
2838
fixture.detectChanges();
2939
});
3040

31-
// it('should create', () => {
32-
// expect(component).toBeTruthy();
33-
// });
41+
it('should create', () => {
42+
expect(component).toBeTruthy();
43+
});
3444
});

testing/test-data.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const allClouds: Cloud[] = [
66
id: '1234',
77
endpoint: 'endpoint.com',
88
cloudType: 'PRIVATE',
9+
api: <Api> {},
910
cloudConfiguration: <CloudConfiguration>{
1011
nodeGroup: 'nodes',
1112
properties: {
@@ -42,6 +43,7 @@ export const cloudOne: Cloud = <Cloud>{
4243
id: '1234',
4344
endpoint: 'endpoint.com',
4445
cloudType: 'PRIVATE',
46+
api: <Api> {},
4547
cloudConfiguration: {
4648
nodeGroup: 'nodes',
4749
properties: [

0 commit comments

Comments
 (0)