From f0931c5746f58b40a7d827b63901c9b0cf925561 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Thu, 7 Feb 2019 09:25:59 +0530 Subject: Test case: ccvpn-detail.component configured test bed for ccvpn-detail component Issue-ID: USECASEUI-195 Change-Id: I8c4ee913336d1d57760c315f023a2b83d910a1f9 Signed-off-by: Arundathi Patil --- .../ccvpn-detail/ccvpn-detail.component.spec.ts | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'usecaseui-portal/src/app/ccvpn-detail/ccvpn-detail.component.spec.ts') diff --git a/usecaseui-portal/src/app/ccvpn-detail/ccvpn-detail.component.spec.ts b/usecaseui-portal/src/app/ccvpn-detail/ccvpn-detail.component.spec.ts index b8afc9c3..dcef893b 100644 --- a/usecaseui-portal/src/app/ccvpn-detail/ccvpn-detail.component.spec.ts +++ b/usecaseui-portal/src/app/ccvpn-detail/ccvpn-detail.component.spec.ts @@ -14,8 +14,13 @@ limitations under the License. */ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { NgZorroAntdModule } from 'ng-zorro-antd'; +import { HttpClientModule } from '@angular/common/http'; +import { NZ_I18N, en_US } from 'ng-zorro-antd'; +import { TranslateModule, TranslateLoader, TranslateService, TranslateFakeLoader} from '@ngx-translate/core'; import { CcvpnDetailComponent } from './ccvpn-detail.component'; +import { MyhttpService } from '../myhttp.service'; describe('CcvpnDetailComponent', () => { let component: CcvpnDetailComponent; @@ -23,18 +28,40 @@ describe('CcvpnDetailComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CcvpnDetailComponent ] + declarations: [ CcvpnDetailComponent ], + imports: [ TranslateModule.forRoot({loader: { provide: TranslateLoader, useClass: TranslateFakeLoader }}), + NgZorroAntdModule.forRoot(), HttpClientModule ], + providers: [ MyhttpService, { provide: NZ_I18N, useValue: en_US } ] }) .compileComponents(); })); beforeEach(() => { + let detailshow = false; + detailData:Object; + let serviceDetail(service){ + service["siteSer"]=[]; + service["sdwanSer"]=[]; + service["customer"]=this.customerSelected; + service["serviceType"] = this.serviceTypeSelected; + + service.childServiceInstances.forEach((item)=>{ + if(item.serviceDomain=="SITE"){ + service.siteSer.push(item); + }else if(item.serviceDomain=="SDWAN"){ + service.sdwanSer.push(item); + } + }) + this.detailshow = true; + this.detailData = service; + component.detailParams = this.detailData fixture = TestBed.createComponent(CcvpnDetailComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { + console.log(component); expect(component).toBeTruthy(); }); }); -- cgit 1.2.3-korg