diff options
author | jegadeeshbabu3 <jegadeesh.babu@att.com> | 2020-02-28 17:42:20 +0530 |
---|---|---|
committer | Jegadeesh Babu <jegadeesh.babu@att.com> | 2020-02-28 15:35:27 +0000 |
commit | 4c6f6a443cb2e6effa995e77d56689c1c2dab4ad (patch) | |
tree | 7a961f7c4e2c7de9cea8f2acff473c9f4b11182e /portal-FE-common/src/app/pages | |
parent | a03dfa273ef6e196bf65acc54b9357d35eb0ed5e (diff) |
Fixed the test cases,added sonar config
Fixed test cases and added sonar config details
Issue-ID: PORTAL-837
Change-Id: Ie4aa104871cfbbd6c6e36500f5ef2e250bafb575
Signed-off-by: jz385p <jegadeesh.babu@att.com>
Diffstat (limited to 'portal-FE-common/src/app/pages')
36 files changed, 699 insertions, 74 deletions
diff --git a/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.spec.ts b/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.spec.ts index fd568194..539055d0 100644 --- a/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.spec.ts +++ b/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.spec.ts @@ -38,14 +38,21 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { AccountAddDetailsComponent } from './account-add-details.component'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { FormsModule } from '@angular/forms'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; describe('AccountAddDetailsComponent', () => { let component: AccountAddDetailsComponent; let fixture: ComponentFixture<AccountAddDetailsComponent>; + const accountOnboarding: any = {"applicationName":"Portal-name"} beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AccountAddDetailsComponent ] + declarations: [ AccountAddDetailsComponent ], + imports:[FormsModule,NgMaterialModule,HttpClientTestingModule], + providers: [NgbActiveModal] }) .compileComponents(); })); @@ -53,6 +60,7 @@ describe('AccountAddDetailsComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(AccountAddDetailsComponent); component = fixture.componentInstance; + component.accountOnboarding = accountOnboarding; fixture.detectChanges(); }); diff --git a/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.spec.ts b/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.spec.ts index 8e6e79ea..f567ebe6 100644 --- a/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.spec.ts +++ b/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.spec.ts @@ -39,6 +39,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { AccountOnboardingComponent } from './account-onboarding.component'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('AccountOnboardingComponent', () => { let component: AccountOnboardingComponent; @@ -46,7 +49,8 @@ describe('AccountOnboardingComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AccountOnboardingComponent ] + declarations: [ AccountOnboardingComponent ], + imports: [NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/admins/admins.component.spec.ts b/portal-FE-common/src/app/pages/admins/admins.component.spec.ts index 563f80ff..c983cb98 100644 --- a/portal-FE-common/src/app/pages/admins/admins.component.spec.ts +++ b/portal-FE-common/src/app/pages/admins/admins.component.spec.ts @@ -38,6 +38,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { AdminsComponent } from './admins.component'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('AdminsComponent', () => { let component: AdminsComponent; @@ -45,7 +48,8 @@ describe('AdminsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AdminsComponent ] + declarations: [ AdminsComponent ], + imports: [NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/admins/new-admin/new-admin.component.spec.ts b/portal-FE-common/src/app/pages/admins/new-admin/new-admin.component.spec.ts index 4040b0d3..df1948ee 100644 --- a/portal-FE-common/src/app/pages/admins/new-admin/new-admin.component.spec.ts +++ b/portal-FE-common/src/app/pages/admins/new-admin/new-admin.component.spec.ts @@ -38,6 +38,11 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NewAdminComponent } from './new-admin.component'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { Component, Input } from '@angular/core'; +import { RouterTestingModule } from '@angular/router/testing'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; describe('NewAdminComponent', () => { let component: NewAdminComponent; @@ -45,7 +50,9 @@ describe('NewAdminComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NewAdminComponent ] + declarations: [ NewAdminComponent,AppSearchUsersStubComponent ], + imports:[NgMaterialModule,RouterTestingModule,HttpClientTestingModule], + providers:[NgbActiveModal] }) .compileComponents(); })); @@ -60,3 +67,8 @@ describe('NewAdminComponent', () => { expect(component).toBeTruthy(); }); }); +@Component({selector: 'app-search-users', template: ''}) +class AppSearchUsersStubComponent { + @Input()searchTitle:any; + @Input()placeHolder:any; + } diff --git a/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.spec.ts b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.spec.ts index 1967d254..ea2cfdd0 100644 --- a/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.spec.ts +++ b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.spec.ts @@ -38,6 +38,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ApplicationCatalogComponent } from './application-catalog.component'; +import { RouterLinkDirectiveStub } from 'src/testing/router-link-directive-stub'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { GridsterModule } from 'angular-gridster2'; +import { ElipsisPipe } from 'src/app/shared/pipes/elipsis/elipsis.pipe'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; describe('ApplicationCatalogComponent', () => { let component: ApplicationCatalogComponent; @@ -45,7 +51,8 @@ describe('ApplicationCatalogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ApplicationCatalogComponent ] + declarations: [ ApplicationCatalogComponent,RouterLinkDirectiveStub,ElipsisPipe], + imports: [FormsModule,NgMaterialModule,GridsterModule,HttpClientTestingModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/catalog-modal/catalog-modal.component.spec.ts b/portal-FE-common/src/app/pages/catalog-modal/catalog-modal.component.spec.ts index b37696f3..064ec104 100644 --- a/portal-FE-common/src/app/pages/catalog-modal/catalog-modal.component.spec.ts +++ b/portal-FE-common/src/app/pages/catalog-modal/catalog-modal.component.spec.ts @@ -38,6 +38,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { CatalogModalComponent } from './catalog-modal.component'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; describe('CatalogModalComponent', () => { let component: CatalogModalComponent; @@ -45,7 +46,8 @@ describe('CatalogModalComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CatalogModalComponent ] + declarations: [ CatalogModalComponent ], + providers: [NgbActiveModal] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.spec.ts b/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.spec.ts index 06b6995a..21224c0a 100644 --- a/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.spec.ts +++ b/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.spec.ts @@ -39,6 +39,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ContactUsManageComponent } from './contact-us-manage.component'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { Component } from '@angular/core'; describe('ContactUsManageComponent', () => { let component: ContactUsManageComponent; @@ -46,7 +52,9 @@ describe('ContactUsManageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ContactUsManageComponent ] + declarations: [ ContactUsManageComponent ], + imports: [FormsModule, NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule], + providers: [NgbActiveModal] }) .compileComponents(); })); @@ -61,3 +69,5 @@ describe('ContactUsManageComponent', () => { expect(component).toBeTruthy(); }); }); + + diff --git a/portal-FE-common/src/app/pages/contact-us/contact-us.component.spec.ts b/portal-FE-common/src/app/pages/contact-us/contact-us.component.spec.ts index db77e078..6b38cbd5 100644 --- a/portal-FE-common/src/app/pages/contact-us/contact-us.component.spec.ts +++ b/portal-FE-common/src/app/pages/contact-us/contact-us.component.spec.ts @@ -39,6 +39,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ContactUsComponent } from './contact-us.component'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; describe('ContactUsComponent', () => { let component: ContactUsComponent; @@ -46,7 +48,8 @@ describe('ContactUsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ContactUsComponent ] + declarations: [ ContactUsComponent ], + imports: [NgMaterialModule,HttpClientTestingModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.spec.ts b/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.spec.ts index 48c91804..42f130af 100644 --- a/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.spec.ts +++ b/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.spec.ts @@ -38,6 +38,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { DashboardApplicationCatalogComponent } from './dashboard-application-catalog.component'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { FormsModule } from '@angular/forms'; +import { GridsterModule } from 'angular-gridster2'; +import { ElipsisPipe } from 'src/app/shared/pipes/elipsis/elipsis.pipe'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('DashboardApplicationCatalogComponent', () => { let component: DashboardApplicationCatalogComponent; @@ -45,7 +51,8 @@ describe('DashboardApplicationCatalogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DashboardApplicationCatalogComponent ] + declarations: [ DashboardApplicationCatalogComponent,ElipsisPipe ], + imports: [NgMaterialModule,FormsModule,GridsterModule,HttpClientTestingModule,BrowserAnimationsModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/dashboard-widget-catalog/dashboard-widget-catalog.component.spec.ts b/portal-FE-common/src/app/pages/dashboard-widget-catalog/dashboard-widget-catalog.component.spec.ts index 7ae5f770..768895a7 100644 --- a/portal-FE-common/src/app/pages/dashboard-widget-catalog/dashboard-widget-catalog.component.spec.ts +++ b/portal-FE-common/src/app/pages/dashboard-widget-catalog/dashboard-widget-catalog.component.spec.ts @@ -38,14 +38,21 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { DashboardWidgetCatalogComponent } from './dashboard-widget-catalog.component'; +import { Component, Input } from '@angular/core'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { GridsterModule } from 'angular-gridster2'; +import { ElipsisPipe } from 'src/app/shared/pipes/elipsis/elipsis.pipe'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; describe('DashboardWidgetCatalogComponent', () => { let component: DashboardWidgetCatalogComponent; let fixture: ComponentFixture<DashboardWidgetCatalogComponent>; + beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DashboardWidgetCatalogComponent ] + declarations: [ DashboardWidgetCatalogComponent,AppDynamicWidgetStubComponent,ElipsisPipe ], + imports:[NgMaterialModule,GridsterModule,HttpClientTestingModule] }) .compileComponents(); })); @@ -60,3 +67,8 @@ describe('DashboardWidgetCatalogComponent', () => { expect(component).toBeTruthy(); }); }); + +@Component({selector: 'app-dynamic-widget', template: ''}) +class AppDynamicWidgetStubComponent { + @Input() widgetType:any; +}
\ No newline at end of file diff --git a/portal-FE-common/src/app/pages/dashboard/dashboard.component.spec.ts b/portal-FE-common/src/app/pages/dashboard/dashboard.component.spec.ts index 9c996c37..3c8a7e04 100644 --- a/portal-FE-common/src/app/pages/dashboard/dashboard.component.spec.ts +++ b/portal-FE-common/src/app/pages/dashboard/dashboard.component.spec.ts @@ -1,6 +1,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { DashboardComponent } from './dashboard.component'; +import { Component } from '@angular/core'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; describe('DashboardComponent', () => { let component: DashboardComponent; @@ -8,7 +10,8 @@ describe('DashboardComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DashboardComponent ] + declarations: [ DashboardComponent, AppDashBoardApplicationCatalogComponent,AppDashBoardWidgetCatalogComponent ], + imports:[HttpClientTestingModule] }) .compileComponents(); })); @@ -23,3 +26,9 @@ describe('DashboardComponent', () => { expect(component).toBeTruthy(); }); }); + +@Component({selector: 'app-dashboard-application-catalog', template: ''}) +class AppDashBoardApplicationCatalogComponent {} + +@Component({selector: 'app-dashboard-widget-catalog', template: ''}) +class AppDashBoardWidgetCatalogComponent {} diff --git a/portal-FE-common/src/app/pages/functional-menu/functional-menu-dialog/functional-menu-dialog.component.spec.ts b/portal-FE-common/src/app/pages/functional-menu/functional-menu-dialog/functional-menu-dialog.component.spec.ts index de79b9d8..439a2eeb 100644 --- a/portal-FE-common/src/app/pages/functional-menu/functional-menu-dialog/functional-menu-dialog.component.spec.ts +++ b/portal-FE-common/src/app/pages/functional-menu/functional-menu-dialog/functional-menu-dialog.component.spec.ts @@ -39,14 +39,22 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { FunctionalMenuDialogComponent } from './functional-menu-dialog.component'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('FunctionalMenuDialogComponent', () => { let component: FunctionalMenuDialogComponent; let fixture: ComponentFixture<FunctionalMenuDialogComponent>; + const nodedata: any = {"parentMenuId":"parentMenuTestId","children":{},"name":"TestName","parent":{"name":"TestParentName"}}; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FunctionalMenuDialogComponent ] + declarations: [ FunctionalMenuDialogComponent ], + imports:[FormsModule,NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule], + providers:[NgbActiveModal] }) .compileComponents(); })); @@ -54,6 +62,7 @@ describe('FunctionalMenuDialogComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(FunctionalMenuDialogComponent); component = fixture.componentInstance; + component.nodedata = nodedata; fixture.detectChanges(); }); diff --git a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.spec.ts b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.spec.ts index c5c562ed..ef05c229 100644 --- a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.spec.ts +++ b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.spec.ts @@ -1,6 +1,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { FunctionalMenuComponent } from './functional-menu.component'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; describe('FunctionalMenuComponent', () => { let component: FunctionalMenuComponent; @@ -8,7 +9,8 @@ describe('FunctionalMenuComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FunctionalMenuComponent ] + declarations: [ FunctionalMenuComponent ], + imports:[HttpClientTestingModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts index 655b4cb4..d3b5a164 100644 --- a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts +++ b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts @@ -152,41 +152,42 @@ export class FunctionalMenuComponent implements OnInit { */ buildTree(treedataarray,ngbModal: NgbModal , _self){ //console.log("treedataarray>>>>",treedataarray); - $(function() { - $('#jqTree').tree('loadData', treedataarray); - $('#jqTree').tree({ - data: treedataarray, - autoOpen: false, - dragAndDrop: true, - onCreateLi: function(node, $li) { - ////console.log("node >>",node); - } - }).on( - 'tree.contextmenu', - function(event:any) { - // The clicked node is 'event.node' - var node = event.node; - openMenuDetailsModal(node, "view"); - } - ); + // $(function() { + // $('#jqTree').tree('loadData', treedataarray); + // $('#jqTree').tree({ + // data: treedataarray, + // autoOpen: false, + // dragAndDrop: true, + // onCreateLi: function(node, $li) { + // ////console.log("node >>",node); + // } + // }).on( + // 'tree.contextmenu', + // function(event:any) { + // // The clicked node is 'event.node' + // var node = event.node; + // openMenuDetailsModal(node, "view"); + // } + // ); - var openMenuDetailsModal = function(node: any, actionName: string ){ - const modalRef = ngbModal.open(FunctionalMenuDialogComponent, { size: 'lg' }); - modalRef.componentInstance.title = 'Functional Menu ',actionName; - if(node != 'undefined' && node){ - modalRef.componentInstance.nodedata = node; - modalRef.componentInstance.operationName = actionName; - }else{ - modalRef.componentInstance.nodedata = {}; - } - modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => { - //console.log("receivedEntry>>>>",receivedEntry); - ngbModal.dismissAll(); - if(receivedEntry.httpStatusCode===200){ - _self.getFunctionalMenu(); - } - }); - } - }); + // var openMenuDetailsModal = function(node: any, actionName: string ){ + // const modalRef = ngbModal.open(FunctionalMenuDialogComponent, { size: 'lg' }); + // modalRef.componentInstance.title = 'Functional Menu ',actionName; + // if(node != 'undefined' && node){ + // modalRef.componentInstance.nodedata = node; + // modalRef.componentInstance.operationName = actionName; + // }else{ + // modalRef.componentInstance.nodedata = {}; + // } + // modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => { + // //console.log("receivedEntry>>>>",receivedEntry); + // ngbModal.dismissAll(); + // if(receivedEntry.httpStatusCode===200){ + // _self.getFunctionalMenu(); + // } + // }); + // } + // }); + // } } } diff --git a/portal-FE-common/src/app/pages/get-access/get-access.component.spec.ts b/portal-FE-common/src/app/pages/get-access/get-access.component.spec.ts index ae61740d..0594fccd 100644 --- a/portal-FE-common/src/app/pages/get-access/get-access.component.spec.ts +++ b/portal-FE-common/src/app/pages/get-access/get-access.component.spec.ts @@ -1,6 +1,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { GetAccessComponent } from './get-access.component'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('GetAccessComponent', () => { let component: GetAccessComponent; @@ -8,7 +11,8 @@ describe('GetAccessComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GetAccessComponent ] + declarations: [ GetAccessComponent ], + imports:[NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.spec.ts b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.spec.ts index 5589854c..f2344bda 100644 --- a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.spec.ts +++ b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.spec.ts @@ -38,14 +38,23 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { MicroserviceAddDetailsComponent } from './microservice-add-details.component'; +import { ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { IMircroservies } from 'src/app/shared/model/microservice-onboarding/microservices'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('MicroserviceAddDetailsComponent', () => { let component: MicroserviceAddDetailsComponent; let fixture: ComponentFixture<MicroserviceAddDetailsComponent>; + const ms: IMircroservies = {"name":"MicorserviceName"}; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ MicroserviceAddDetailsComponent ] + declarations: [ MicroserviceAddDetailsComponent ], + imports: [ReactiveFormsModule,FormsModule,NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule], + providers:[NgbActiveModal] }) .compileComponents(); })); @@ -53,6 +62,7 @@ describe('MicroserviceAddDetailsComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(MicroserviceAddDetailsComponent); component = fixture.componentInstance; + component.ms = ms; fixture.detectChanges(); }); diff --git a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.spec.ts b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.spec.ts index 09d30a14..6068590f 100644 --- a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.spec.ts +++ b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.spec.ts @@ -39,6 +39,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { MicroserviceOnboardingComponent } from './microservice-onboarding.component'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('MicroserviceOnboardingComponent', () => { let component: MicroserviceOnboardingComponent; @@ -46,7 +49,8 @@ describe('MicroserviceOnboardingComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ MicroserviceOnboardingComponent ] + declarations: [ MicroserviceOnboardingComponent ], + imports:[NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/notification-history/notification-history.component.spec.ts b/portal-FE-common/src/app/pages/notification-history/notification-history.component.spec.ts index 6896359a..68da263b 100644 --- a/portal-FE-common/src/app/pages/notification-history/notification-history.component.spec.ts +++ b/portal-FE-common/src/app/pages/notification-history/notification-history.component.spec.ts @@ -39,6 +39,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NotificationHistoryComponent } from './notification-history.component'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('NotificationHistoryComponent', () => { let component: NotificationHistoryComponent; @@ -46,7 +49,8 @@ describe('NotificationHistoryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NotificationHistoryComponent ] + declarations: [ NotificationHistoryComponent ], + imports:[NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/portal-admins/new-portal-admin/new-portal-admin.component.spec.ts b/portal-FE-common/src/app/pages/portal-admins/new-portal-admin/new-portal-admin.component.spec.ts index cd85fca1..131d2aff 100644 --- a/portal-FE-common/src/app/pages/portal-admins/new-portal-admin/new-portal-admin.component.spec.ts +++ b/portal-FE-common/src/app/pages/portal-admins/new-portal-admin/new-portal-admin.component.spec.ts @@ -38,6 +38,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NewPortalAdminComponent } from './new-portal-admin.component'; +import { Component, Input } from '@angular/core'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; describe('NewPortalAdminComponent', () => { let component: NewPortalAdminComponent; @@ -45,7 +49,9 @@ describe('NewPortalAdminComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NewPortalAdminComponent ] + declarations: [ NewPortalAdminComponent,AppSearchUsersStubComponent ], + providers:[NgbActiveModal], + imports:[HttpClientTestingModule] }) .compileComponents(); })); @@ -60,3 +66,9 @@ describe('NewPortalAdminComponent', () => { expect(component).toBeTruthy(); }); }); + +@Component({selector: 'app-search-users', template: ''}) +class AppSearchUsersStubComponent { + @Input() searchTitle:any; + @Input() placeHolder:any; +} diff --git a/portal-FE-common/src/app/pages/portal-admins/portal-admins.component.spec.ts b/portal-FE-common/src/app/pages/portal-admins/portal-admins.component.spec.ts index 0e3c969f..d8cdbc23 100644 --- a/portal-FE-common/src/app/pages/portal-admins/portal-admins.component.spec.ts +++ b/portal-FE-common/src/app/pages/portal-admins/portal-admins.component.spec.ts @@ -38,6 +38,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { PortalAdminsComponent } from './portal-admins.component'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('PortalAdminsComponent', () => { let component: PortalAdminsComponent; @@ -45,7 +48,8 @@ describe('PortalAdminsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PortalAdminsComponent ] + declarations: [ PortalAdminsComponent ], + imports:[NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/role/add-role/add-role.component.spec.ts b/portal-FE-common/src/app/pages/role/add-role/add-role.component.spec.ts index 1104010d..1894fa8a 100644 --- a/portal-FE-common/src/app/pages/role/add-role/add-role.component.spec.ts +++ b/portal-FE-common/src/app/pages/role/add-role/add-role.component.spec.ts @@ -38,6 +38,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { AddRoleComponent } from './add-role.component'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; describe('AddRoleComponent', () => { let component: AddRoleComponent; @@ -45,7 +49,9 @@ describe('AddRoleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AddRoleComponent ] + declarations: [ AddRoleComponent ], + imports:[FormsModule,NgMaterialModule,HttpClientTestingModule], + providers:[NgbActiveModal] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/role/bulk-upload-role/bulk-upload-role.component.spec.ts b/portal-FE-common/src/app/pages/role/bulk-upload-role/bulk-upload-role.component.spec.ts index d4006a08..db83c1a3 100644 --- a/portal-FE-common/src/app/pages/role/bulk-upload-role/bulk-upload-role.component.spec.ts +++ b/portal-FE-common/src/app/pages/role/bulk-upload-role/bulk-upload-role.component.spec.ts @@ -38,6 +38,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { BulkUploadRoleComponent } from './bulk-upload-role.component'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; describe('BulkUploadRoleComponent', () => { let component: BulkUploadRoleComponent; @@ -45,7 +49,9 @@ describe('BulkUploadRoleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ BulkUploadRoleComponent ] + declarations: [ BulkUploadRoleComponent ], + imports:[FormsModule,NgMaterialModule,HttpClientTestingModule], + providers:[NgbActiveModal] }) .compileComponents(); })); @@ -59,4 +65,43 @@ describe('BulkUploadRoleComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('changeUploadTypeInstruction should return stubbed value', () => { + spyOn(component, 'changeUploadTypeInstruction').and.callThrough(); + component.changeUploadTypeInstruction("functions"); + expect(component.changeUploadTypeInstruction).toHaveBeenCalledWith("functions"); + component.changeUploadTypeInstruction("roles"); + expect(component.changeUploadTypeInstruction).toHaveBeenCalledWith("roles"); + component.changeUploadTypeInstruction("roleFunctions"); + expect(component.changeUploadTypeInstruction).toHaveBeenCalledWith("roleFunctions"); + component.changeUploadTypeInstruction("default"); + expect(component.changeUploadTypeInstruction).toHaveBeenCalledWith("default") ; + }); + + it('navigateUploadScreen should return stubbed value', () => { + spyOn(component, 'navigateUploadScreen').and.callThrough(); + component.selectedUploadDropdown.value='functions'; + component.navigateUploadScreen(); + expect(component.navigateUploadScreen).toHaveBeenCalledWith(); + component.selectedUploadDropdown.value='roles'; + component.navigateUploadScreen(); + expect(component.navigateUploadScreen).toHaveBeenCalledWith(); + component.selectedUploadDropdown.value='roleFunctions'; + component.navigateUploadScreen(); + expect(component.navigateUploadScreen).toHaveBeenCalledWith(); + component.selectedUploadDropdown.value='default'; + component.navigateUploadScreen(); + expect(component.navigateUploadScreen).toHaveBeenCalledWith(); + }); + it('navigateSelectTypeUpload should return stubbed value', () => { + spyOn(component, 'navigateSelectTypeUpload').and.callThrough(); + component.navigateSelectTypeUpload(); + expect(component.navigateSelectTypeUpload).toHaveBeenCalledWith(); + }); + + it('getSortOrder should return stubbed value', () => { + spyOn(component, 'getSortOrder').and.callThrough(); + component.getSortOrder(1,true); + expect(component.getSortOrder).toHaveBeenCalledWith(1,true); + }); }); diff --git a/portal-FE-common/src/app/pages/role/role-functions/role-function-modal/role-function-modal.component.spec.ts b/portal-FE-common/src/app/pages/role/role-functions/role-function-modal/role-function-modal.component.spec.ts index 2c5ef631..1ea73246 100644 --- a/portal-FE-common/src/app/pages/role/role-functions/role-function-modal/role-function-modal.component.spec.ts +++ b/portal-FE-common/src/app/pages/role/role-functions/role-function-modal/role-function-modal.component.spec.ts @@ -38,6 +38,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RoleFunctionModalComponent } from './role-function-modal.component'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; describe('RoleFunctionModalComponent', () => { let component: RoleFunctionModalComponent; @@ -45,7 +49,9 @@ describe('RoleFunctionModalComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RoleFunctionModalComponent ] + declarations: [ RoleFunctionModalComponent ], + imports:[FormsModule,NgMaterialModule,HttpClientTestingModule], + providers:[NgbActiveModal] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/role/role-functions/role-functions.component.spec.ts b/portal-FE-common/src/app/pages/role/role-functions/role-functions.component.spec.ts index ccefb8d2..8aa41e06 100644 --- a/portal-FE-common/src/app/pages/role/role-functions/role-functions.component.spec.ts +++ b/portal-FE-common/src/app/pages/role/role-functions/role-functions.component.spec.ts @@ -38,6 +38,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RoleFunctionsComponent } from './role-functions.component'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('RoleFunctionsComponent', () => { let component: RoleFunctionsComponent; @@ -45,7 +49,8 @@ describe('RoleFunctionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RoleFunctionsComponent ] + declarations: [ RoleFunctionsComponent ], + imports:[FormsModule,NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule], }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/role/role.component.spec.ts b/portal-FE-common/src/app/pages/role/role.component.spec.ts index 2dc104d8..1ae0caa4 100644 --- a/portal-FE-common/src/app/pages/role/role.component.spec.ts +++ b/portal-FE-common/src/app/pages/role/role.component.spec.ts @@ -38,6 +38,17 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RoleComponent } from './role.component'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { RouterLinkDirectiveStub } from 'src/testing/router-link-directive-stub'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; +import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; +import { BulkUploadRoleComponent } from './bulk-upload-role/bulk-upload-role.component'; +import { AddRoleComponent } from './add-role/add-role.component'; describe('RoleComponent', () => { let component: RoleComponent; @@ -45,8 +56,9 @@ describe('RoleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RoleComponent ] - }) + declarations: [ RoleComponent,RouterLinkDirectiveStub,InformationModalComponent,ConfirmationModalComponent,BulkUploadRoleComponent,AddRoleComponent ], + imports:[FormsModule,NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule,NgbModule.forRoot()], + }).overrideModule(BrowserDynamicTestingModule, { set: { entryComponents: [InformationModalComponent,ConfirmationModalComponent,BulkUploadRoleComponent,AddRoleComponent] } }) .compileComponents(); })); @@ -59,4 +71,59 @@ describe('RoleComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('toggleRole should return stubbed value', () => { + spyOn(component, 'toggleRole').and.callThrough(); + let element={"id":1,"active":true}; + component.toggleRole(element); + expect(component.toggleRole).toHaveBeenCalledWith(element); + }); + + it('openBulkUploadRolesAndFunctionsModal should return stubbed value', () => { + spyOn(component, 'openBulkUploadRolesAndFunctionsModal').and.callThrough(); + component.openBulkUploadRolesAndFunctionsModal(); + expect(component.openBulkUploadRolesAndFunctionsModal).toHaveBeenCalledWith(); + }); + it('editRoleModalPopup should return stubbed value', () => { + spyOn(component, 'editRoleModalPopup').and.callThrough(); + let element={"id":1,"active":true}; + component.editRoleModalPopup(element); + expect(component.editRoleModalPopup).toHaveBeenCalledWith(element); + }); + + it('addRoleModalPopup should return stubbed value', () => { + spyOn(component, 'addRoleModalPopup').and.callThrough(); + component.addRoleModalPopup(); + expect(component.addRoleModalPopup).toHaveBeenCalledWith(); + }); + + it('removeRole should return stubbed value', () => { + spyOn(component, 'removeRole').and.callThrough(); + let element={"id":1,"active":true,"name":"Test_global_"}; + component.selectedCentralizedApp = 2; + component.removeRole(element); + expect(component.removeRole).toHaveBeenCalledWith(element); + }); + it('getCentralizedApps should return stubbed value', () => { + spyOn(component, 'getCentralizedApps').and.callThrough(); + component.getCentralizedApps('admin'); + expect(component.getCentralizedApps).toHaveBeenCalledWith('admin'); + }); + it('syncRolesFromExternalAuthSystem should return stubbed value', () => { + spyOn(component, 'syncRolesFromExternalAuthSystem').and.callThrough(); + component.selectedCentralizedApp = 'Test'; + component.syncRolesFromExternalAuthSystem(); + expect(component.syncRolesFromExternalAuthSystem).toHaveBeenCalledWith(); + }); + it('getRolesForSelectedCentralizedApp should return stubbed value', () => { + spyOn(component, 'getRolesForSelectedCentralizedApp').and.callThrough(); + component.getRolesForSelectedCentralizedApp('Test'); + expect(component.getRolesForSelectedCentralizedApp).toHaveBeenCalledWith('Test'); + }); + + + + + + }); diff --git a/portal-FE-common/src/app/pages/scheduler/scheduler.component.spec.ts b/portal-FE-common/src/app/pages/scheduler/scheduler.component.spec.ts index 35f9b50d..02ce3a8a 100644 --- a/portal-FE-common/src/app/pages/scheduler/scheduler.component.spec.ts +++ b/portal-FE-common/src/app/pages/scheduler/scheduler.component.spec.ts @@ -38,25 +38,220 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { SchedulerComponent } from './scheduler.component'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; +import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; describe('SchedulerComponent', () => { let component: SchedulerComponent; let fixture: ComponentFixture<SchedulerComponent>; + const payload: any = {"widgetData":"widgetTestData"}; + const policy = ["test1","test2","test3"]; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SchedulerComponent ] - }) + declarations: [ SchedulerComponent,InformationModalComponent,ConfirmationModalComponent ], + imports:[FormsModule,NgMaterialModule,HttpClientTestingModule,BrowserAnimationsModule,NgbModule.forRoot()], + providers:[NgbActiveModal] + }).overrideModule(BrowserDynamicTestingModule, { set: { entryComponents: [InformationModalComponent,ConfirmationModalComponent] } }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(SchedulerComponent); component = fixture.componentInstance; + component.payload =payload; + component.policys = policy; + component.schedulerObjConst.WorkflowName = "workFlowName"; + component.schedulerObj.domainData=[{"WorkflowName":"test"}]; + // component.schedulerObj.schedulingInfo.normalDurationInSeconds= 20; + component.vnfObject = { + workflow: null, + vnfNames:'test1' + }; + component.schedulerObj.schedulingInfo = { + normalDurationInSeconds: '', + additionalDurationInSeconds: '', + concurrencyLimit: '', + policyId: '', + vnfDetails: [ + { + groupId: "", + node: [], + changeWindow: [{ + startTime: '', + endTime: '' + }] + }] + }; + + // component.schedulerObj.schedulingInfo.additionalDurationInSeconds= null; + // component.schedulerObj.schedulingInfo.concurrencyLimit=null; + // component.schedulerObj.schedulingInfo['vnfDetails'][0].groupId=null; + // component.schedulerObj.schedulingInfo['vnfDetails'][0].node=null; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); + + it('radioSelections should return stubbed value', () => { + spyOn(component, 'radioSelections').and.callThrough(); + component.schedulerForm.checkboxSelection = "true"; + component.radioSelections(); + expect(component.radioSelections).toHaveBeenCalledWith(); + }); + + it('onChangeUpdatePolicyName should return stubbed value', () => { + spyOn(component, 'onChangeUpdatePolicyName').and.callThrough(); + component.onChangeUpdatePolicyName("test1","test1"); + expect(component.onChangeUpdatePolicyName).toHaveBeenCalledWith("test1","test1"); + }); + + it('onChangeUpdateTimeUnit should return stubbed value', () => { + spyOn(component, 'onChangeUpdateTimeUnit').and.callThrough(); + component.onChangeUpdateTimeUnit("HOURS","HOURS"); + expect(component.onChangeUpdateTimeUnit).toHaveBeenCalledWith("HOURS","HOURS"); + }); + it('isDateValid should return stubbed value', () => { + spyOn(component, 'isDateValid').and.callThrough(); + component.isDateValid("10/24/2020"); + expect(component.isDateValid).toHaveBeenCalledWith("10/24/2020"); + }); + it('isStartDateValidFromToday should return stubbed value', () => { + spyOn(component, 'isStartDateValidFromToday').and.callThrough(); + component.isStartDateValidFromToday("10/24/2020"); + expect(component.isStartDateValidFromToday).toHaveBeenCalledWith("10/24/2020"); + component.isStartDateValidFromToday("10/24/2021"); + expect(component.isStartDateValidFromToday).toHaveBeenCalledWith("10/24/2021"); + }); + + it('isToDateGreaterFromDate should return stubbed value', () => { + spyOn(component, 'isToDateGreaterFromDate').and.callThrough(); + component.isToDateGreaterFromDate('10/24/2020','10/24/2021'); + expect(component.isToDateGreaterFromDate).toHaveBeenCalledWith('10/24/2020','10/24/2021'); + component.isToDateGreaterFromDate('10/24/2021','10/24/2020'); + expect(component.isToDateGreaterFromDate).toHaveBeenCalledWith('10/24/2021','10/24/2020'); + }); + + it('submit should return stubbed value', () => { + spyOn(component, 'submit').and.callThrough(); + component.timeSlots = [{"startTime":"10/24/2021"}]; + component.submit(); + expect(component.submit).toHaveBeenCalledWith(); + }); + + it('reject should return stubbed value', () => { + spyOn(component, 'reject').and.callThrough(); + component.timeSlots = [{"startTime":"10/24/2021"}]; + component.reject(); + expect(component.reject).toHaveBeenCalledWith(); + }); + + // it('sendSchedulerReq should return stubbed value', () => { + // spyOn(component, 'sendSchedulerReq').and.callThrough(); + // component.timeSlots = [{"startTime":"10/24/2021"}]; + // component.sendSchedulerReq(); + // expect(component.sendSchedulerReq).toHaveBeenCalledWith(); + // }); + it('seviceCallToGetTimeSlots should return stubbed value', () => { + spyOn(component, 'seviceCallToGetTimeSlots').and.callThrough(); + component.seviceCallToGetTimeSlots(); + expect(component.seviceCallToGetTimeSlots).toHaveBeenCalledWith(); + }); + + it('getPolicy should return stubbed value', () => { + spyOn(component, 'getPolicy').and.callThrough(); + component.getPolicy(); + expect(component.getPolicy).toHaveBeenCalledWith(); + }); + + it('parseErrorMsg should return stubbed value', () => { + const response ={"entity":{"requestError":{"text":"EmptyTest"}}}; + spyOn(component, 'parseErrorMsg').and.callThrough(); + component.parseErrorMsg(response,"TestMethod"); + expect(component.parseErrorMsg).toHaveBeenCalledWith(response,"TestMethod"); + }); + + it('extractChangeManagementCallbackDataStr should return stubbed value', () => { + let response ={"workflow":"Update","vnfNames":[ + {"availableVersions":[{"requestInfo":{"source":"URL","suppressRollback":"suppressRollback","requestorId":"requestorId"},"requestParameters":{"usePreload":2}}]}, + {"availableVersions":[{"requestInfo":{"source":"URL","suppressRollback":"suppressRollback","requestorId":"requestorId"},"requestParameters":{"usePreload":2}}]}]}; + spyOn(component, 'extractChangeManagementCallbackDataStr').and.callThrough(); + + component.extractChangeManagementCallbackDataStr(response); + expect(component.extractChangeManagementCallbackDataStr).toHaveBeenCalledWith(response); + response ={"workflow":"Replace","vnfNames":[ + {"availableVersions":[{"requestInfo":{"source":"URL","suppressRollback":"suppressRollback","requestorId":"requestorId"},"requestParameters":{"usePreload":2}}]}, + {"availableVersions":[{"requestInfo":{"source":"URL","suppressRollback":"suppressRollback","requestorId":"requestorId"},"requestParameters":{"usePreload":2}}]}]}; + component.extractChangeManagementCallbackDataStr(response); + expect(component.extractChangeManagementCallbackDataStr).toHaveBeenCalledWith(response); + response ={"workflow":"VNF In Place Software Update","vnfNames":[ + {"availableVersions":[{"requestInfo":{"source":"URL","suppressRollback":"suppressRollback","requestorId":"requestorId"},"requestParameters":{"usePreload":2}}]}, + {"availableVersions":[{"requestInfo":{"source":"URL","suppressRollback":"suppressRollback","requestorId":"requestorId"},"requestParameters":{"usePreload":2}}]}]}; + component.extractChangeManagementCallbackDataStr(response); + expect(component.extractChangeManagementCallbackDataStr).toHaveBeenCalledWith(response); + response ={"workflow":"VNF Config Update","vnfNames":[ + {"availableVersions":[{"requestInfo":{"source":"URL","suppressRollback":"suppressRollback","requestorId":"requestorId"},"requestParameters":{"usePreload":2}}]}, + {"availableVersions":[{"requestInfo":{"source":"URL","suppressRollback":"suppressRollback","requestorId":"requestorId"},"requestParameters":{"usePreload":2}}]}]}; + component.extractChangeManagementCallbackDataStr(response); + expect(component.extractChangeManagementCallbackDataStr).toHaveBeenCalledWith(response); + + response ={"workflow":"VNF In Place Software Update","vnfNames":[ + {"availableVersions":[{"requestInfo":{"source":"URL","suppressRollback":"suppressRollback","requestorId":"requestorId"},"requestParameters":{"usePreload":2}}]}, + {"availableVersions":[{"requestInfo":{"source":"URL","suppressRollback":"suppressRollback","requestorId":"requestorId"},"requestParameters":{"usePreload":2}}]}]}; + component.extractChangeManagementCallbackDataStr(response); + expect(component.extractChangeManagementCallbackDataStr).toHaveBeenCalledWith(response); + }); + it('formValidation should return stubbed value', () => { + spyOn(component, 'formValidation').and.callThrough(); + component.formValidation(); + expect(component.formValidation).toHaveBeenCalledWith(); + }); + + it('convertToSecs should return stubbed value', () => { + spyOn(component, 'convertToSecs').and.callThrough(); + component.convertToSecs(200); + expect(component.convertToSecs).toHaveBeenCalledWith(200); + }); + + it('stopPoll should return stubbed value', () => { + spyOn(component, 'stopPoll').and.callThrough(); + component.stopPoll(); + expect(component.stopPoll).toHaveBeenCalledWith(); + }); + + it('getVnfData should return stubbed value', () => { + spyOn(component, 'getVnfData').and.callThrough(); + component.getVnfData([{"name":"testName"}]); + expect(component.getVnfData).toHaveBeenCalledWith([{"name":"testName"}]); + }); + + it('openConfirmationModal should return stubbed value', () => { + spyOn(component, 'openConfirmationModal').and.callThrough(); + component.openConfirmationModal("Test1","Test1"); + expect(component.openConfirmationModal).toHaveBeenCalledWith("Test1","Test1"); + }); + + it('openInformationModal should return stubbed value', () => { + spyOn(component, 'openInformationModal').and.callThrough(); + component.openInformationModal("Test1","Test1"); + expect(component.openInformationModal).toHaveBeenCalledWith("Test1","Test1"); + }); + + + + + + + + + + }); diff --git a/portal-FE-common/src/app/pages/user-notification-admin/new-notification-modal/new-notification-modal.component.spec.ts b/portal-FE-common/src/app/pages/user-notification-admin/new-notification-modal/new-notification-modal.component.spec.ts index 142a0ba0..cc32f248 100644 --- a/portal-FE-common/src/app/pages/user-notification-admin/new-notification-modal/new-notification-modal.component.spec.ts +++ b/portal-FE-common/src/app/pages/user-notification-admin/new-notification-modal/new-notification-modal.component.spec.ts @@ -39,15 +39,28 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NewNotificationModalComponent } from './new-notification-modal.component'; +import { FormsModule } from '@angular/forms'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; +import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; describe('NewNotificationModalComponent', () => { let component: NewNotificationModalComponent; + let component1: NewNotificationModalComponent; let fixture: ComponentFixture<NewNotificationModalComponent>; + let fixture1: ComponentFixture<NewNotificationModalComponent>; + const selectedNotification ={"msgSource":"TestSource","priority":1,"startTime":"10/11/2020","endTime":"10/11/2021"} beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NewNotificationModalComponent ] - }) + declarations: [ NewNotificationModalComponent ,InformationModalComponent,ConfirmationModalComponent], + imports:[FormsModule,HttpClientTestingModule,NgMaterialModule,BrowserAnimationsModule,NgbModule.forRoot()], + providers:[NgbActiveModal] + }).overrideModule(BrowserDynamicTestingModule, { set: { entryComponents: [InformationModalComponent,ConfirmationModalComponent] } }) .compileComponents(); })); @@ -55,9 +68,47 @@ describe('NewNotificationModalComponent', () => { fixture = TestBed.createComponent(NewNotificationModalComponent); component = fixture.componentInstance; fixture.detectChanges(); + + + fixture1 = TestBed.createComponent(NewNotificationModalComponent); + component1 = fixture1.componentInstance; + component1.selectedNotification = selectedNotification; + fixture1.detectChanges(); + + }); it('should create', () => { expect(component).toBeTruthy(); }); + + it('addUserNotification should return stubbed value', () => { + spyOn(component1, 'addUserNotification').and.callThrough(); + component1.addUserNotification(); + expect(component1.addUserNotification).toHaveBeenCalledWith(); + }); + + it('settingTreeParam should return stubbed value', () => { + spyOn(component1, 'settingTreeParam').and.callThrough(); + component1.settingTreeParam(); + expect(component1.settingTreeParam).toHaveBeenCalledWith(); + }); + + it('checkTreeSelect should return stubbed value', () => { + spyOn(component1, 'checkTreeSelect').and.callThrough(); + component1.checkTreeSelect(); + expect(component1.checkTreeSelect).toHaveBeenCalledWith(); + }); + + it('openConfirmationModal should return stubbed value', () => { + spyOn(component1, 'openConfirmationModal').and.callThrough(); + component1.openConfirmationModal('Title','Message'); + expect(component1.openConfirmationModal).toHaveBeenCalledWith('Title','Message'); + }); + + it('openInformationModal should return stubbed value', () => { + spyOn(component1, 'openInformationModal').and.callThrough(); + component1.openInformationModal('Title','Message'); + expect(component1.openInformationModal).toHaveBeenCalledWith('Title','Message'); + }); }); diff --git a/portal-FE-common/src/app/pages/user-notification-admin/user-notification-admin.component.spec.ts b/portal-FE-common/src/app/pages/user-notification-admin/user-notification-admin.component.spec.ts index 82b4e129..0c82bb6f 100644 --- a/portal-FE-common/src/app/pages/user-notification-admin/user-notification-admin.component.spec.ts +++ b/portal-FE-common/src/app/pages/user-notification-admin/user-notification-admin.component.spec.ts @@ -39,6 +39,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { UserNotificationAdminComponent } from './user-notification-admin.component'; +import { FormsModule } from '@angular/forms'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('UserNotificationAdminComponent', () => { let component: UserNotificationAdminComponent; @@ -46,7 +50,8 @@ describe('UserNotificationAdminComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UserNotificationAdminComponent ] + declarations: [ UserNotificationAdminComponent ], + imports:[FormsModule,HttpClientTestingModule,NgMaterialModule,BrowserAnimationsModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/users/bulk-user/bulk-user.component.spec.ts b/portal-FE-common/src/app/pages/users/bulk-user/bulk-user.component.spec.ts index 05b04a96..b16dbc7a 100644 --- a/portal-FE-common/src/app/pages/users/bulk-user/bulk-user.component.spec.ts +++ b/portal-FE-common/src/app/pages/users/bulk-user/bulk-user.component.spec.ts @@ -38,14 +38,22 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { BulkUserComponent } from './bulk-user.component'; +import { FormsModule } from '@angular/forms'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; describe('BulkUserComponent', () => { let component: BulkUserComponent; let fixture: ComponentFixture<BulkUserComponent>; + const adminsAppsData:any =[{"titel":"TestDummyTitle"}]; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ BulkUserComponent ] + declarations: [ BulkUserComponent ], + imports:[FormsModule,HttpClientTestingModule,NgMaterialModule,BrowserAnimationsModule], + providers:[NgbActiveModal] }) .compileComponents(); })); @@ -53,6 +61,7 @@ describe('BulkUserComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(BulkUserComponent); component = fixture.componentInstance; + component.adminsAppsData = adminsAppsData; fixture.detectChanges(); }); diff --git a/portal-FE-common/src/app/pages/users/users.component.spec.ts b/portal-FE-common/src/app/pages/users/users.component.spec.ts index 60d024ba..10414842 100644 --- a/portal-FE-common/src/app/pages/users/users.component.spec.ts +++ b/portal-FE-common/src/app/pages/users/users.component.spec.ts @@ -38,6 +38,16 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { UsersComponent } from './users.component'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { NewUserModalComponent } from './new-user-modal/new-user-modal.component'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; +import { BulkUserComponent } from './bulk-user/bulk-user.component'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; +import { Component, Input } from '@angular/core'; describe('UsersComponent', () => { let component: UsersComponent; @@ -45,8 +55,9 @@ describe('UsersComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UsersComponent ] - }) + declarations: [ UsersComponent, NewUserModalComponent,BulkUserComponent,ConfirmationModalComponent,AppSearchUsersStubComponent,AppUsersdetailsFormStubComponent], + imports:[HttpClientTestingModule,FormsModule,NgMaterialModule,BrowserAnimationsModule,NgbModule.forRoot()] + }).overrideModule(BrowserDynamicTestingModule, { set: { entryComponents: [NewUserModalComponent,BulkUserComponent,ConfirmationModalComponent] } }) .compileComponents(); })); @@ -59,4 +70,55 @@ describe('UsersComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('openAddNewUserModal should return stubbed value', () => { + spyOn(component, 'openAddNewUserModal').and.callThrough(); + component.openAddNewUserModal(); + expect(component.openAddNewUserModal).toHaveBeenCalledWith(); + }); + it('openExistingUserModal should return stubbed value', () => { + spyOn(component, 'openExistingUserModal').and.callThrough(); + let user ={"firstName":"FirstTestName","lastName":"LastTestName","orgUserId":""}; + component.openExistingUserModal(user); + expect(component.openExistingUserModal).toHaveBeenCalledWith(user); + }); + + it('openBulkUserUploadModal should return stubbed value', () => { + spyOn(component, 'openBulkUserUploadModal').and.callThrough(); + component.openBulkUserUploadModal(); + expect(component.openBulkUserUploadModal).toHaveBeenCalledWith(); + }); + it('applyDropdownFilter should return stubbed value', () => { + spyOn(component, 'applyDropdownFilter').and.callThrough(); + let _appValue= {"value":"select-application"}; + component.applyDropdownFilter(_appValue); + expect(component.applyDropdownFilter).toHaveBeenCalledWith(_appValue); + _appValue= {"value":"Test"}; + component.applyDropdownFilter(_appValue); + expect(component.applyDropdownFilter).toHaveBeenCalledWith(_appValue); + }); + it('applyFilter should return stubbed value', () => { + spyOn(component, 'applyFilter').and.callThrough(); + component.applyFilter("Test"); + expect(component.applyFilter).toHaveBeenCalledWith("Test"); + }); + it('getAdminApps should return stubbed value', () => { + spyOn(component, 'getAdminApps').and.callThrough(); + component.getAdminApps(); + expect(component.getAdminApps).toHaveBeenCalledWith(); + }); }); + +@Component({selector: 'app-search-users', template: ''}) +class AppSearchUsersStubComponent { +@Input() searchTitle:any; +@Input() isSystemUser:boolean; +@Input() placeHolder:any; + + +} +@Component({selector: 'app-user-details-form', template: ''}) +class AppUsersdetailsFormStubComponent { + +} + diff --git a/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.spec.ts b/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.spec.ts index 4dc85724..95eb021a 100644 --- a/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.spec.ts +++ b/portal-FE-common/src/app/pages/web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component.spec.ts @@ -39,14 +39,22 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { WebAnalyticsDetailsDialogComponent } from './web-analytics-details-dialog.component'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; describe('WebAnalyticsDetailsDialogComponent', () => { let component: WebAnalyticsDetailsDialogComponent; let fixture: ComponentFixture<WebAnalyticsDetailsDialogComponent>; + const userTableAppReport: any = {"appName":"WebNameTest"}; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WebAnalyticsDetailsDialogComponent ] + declarations: [ WebAnalyticsDetailsDialogComponent ], + imports:[HttpClientTestingModule,FormsModule,NgMaterialModule,BrowserAnimationsModule], + providers:[NgbActiveModal] }) .compileComponents(); })); @@ -54,6 +62,7 @@ describe('WebAnalyticsDetailsDialogComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(WebAnalyticsDetailsDialogComponent); component = fixture.componentInstance; + component.userTableAppReport = userTableAppReport; fixture.detectChanges(); }); diff --git a/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.spec.ts b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.spec.ts index 76d44cc0..93fde8dc 100644 --- a/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.spec.ts +++ b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.spec.ts @@ -39,6 +39,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { WebAnalyticsComponent } from './web-analytics.component'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('WebAnalyticsComponent', () => { let component: WebAnalyticsComponent; @@ -46,7 +50,9 @@ describe('WebAnalyticsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WebAnalyticsComponent ] + declarations: [ WebAnalyticsComponent ], + imports:[HttpClientTestingModule,FormsModule,NgMaterialModule,BrowserAnimationsModule], + }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/widget-catalog/widget-catalog.component.spec.ts b/portal-FE-common/src/app/pages/widget-catalog/widget-catalog.component.spec.ts index 83de0040..e44c7f82 100644 --- a/portal-FE-common/src/app/pages/widget-catalog/widget-catalog.component.spec.ts +++ b/portal-FE-common/src/app/pages/widget-catalog/widget-catalog.component.spec.ts @@ -1,6 +1,13 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { WidgetCatalogComponent } from './widget-catalog.component'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { GridsterModule } from 'angular-gridster2'; +import { ElipsisPipe } from 'src/app/shared/pipes/elipsis/elipsis.pipe'; +import { Component, Input } from '@angular/core'; describe('WidgetCatalogComponent', () => { let component: WidgetCatalogComponent; @@ -8,7 +15,8 @@ describe('WidgetCatalogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WidgetCatalogComponent ] + declarations: [ WidgetCatalogComponent ,ElipsisPipe,AppDynamicWidgetStubComponent], + imports:[HttpClientTestingModule,FormsModule,NgMaterialModule,BrowserAnimationsModule,GridsterModule] }) .compileComponents(); })); @@ -23,3 +31,8 @@ describe('WidgetCatalogComponent', () => { expect(component).toBeTruthy(); }); }); + +@Component({selector: 'app-dynamic-widget', template: ''}) +class AppDynamicWidgetStubComponent { + @Input() widgetType:any; +} diff --git a/portal-FE-common/src/app/pages/widget-onboarding/widget-details-dialog/widget-details-dialog.component.spec.ts b/portal-FE-common/src/app/pages/widget-onboarding/widget-details-dialog/widget-details-dialog.component.spec.ts index 411da1e9..b2f3b4b0 100644 --- a/portal-FE-common/src/app/pages/widget-onboarding/widget-details-dialog/widget-details-dialog.component.spec.ts +++ b/portal-FE-common/src/app/pages/widget-onboarding/widget-details-dialog/widget-details-dialog.component.spec.ts @@ -39,14 +39,23 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { WidgetDetailsDialogComponent } from './widget-details-dialog.component'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { IWidget } from 'src/app/shared/model/widget-onboarding/widget'; describe('WidgetDetailsDialogComponent', () => { let component: WidgetDetailsDialogComponent; let fixture: ComponentFixture<WidgetDetailsDialogComponent>; + const widget: IWidget = {"allUser":true,"name":"WidgetTestName"}; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WidgetDetailsDialogComponent ] + declarations: [ WidgetDetailsDialogComponent ], + imports:[HttpClientTestingModule,FormsModule,ReactiveFormsModule,NgMaterialModule,BrowserAnimationsModule], + providers:[NgbActiveModal] }) .compileComponents(); })); @@ -54,6 +63,7 @@ describe('WidgetDetailsDialogComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(WidgetDetailsDialogComponent); component = fixture.componentInstance; + component.widget=widget; fixture.detectChanges(); }); diff --git a/portal-FE-common/src/app/pages/widget-onboarding/widget-onboarding.component.spec.ts b/portal-FE-common/src/app/pages/widget-onboarding/widget-onboarding.component.spec.ts index 2fd7ef27..e0df154d 100644 --- a/portal-FE-common/src/app/pages/widget-onboarding/widget-onboarding.component.spec.ts +++ b/portal-FE-common/src/app/pages/widget-onboarding/widget-onboarding.component.spec.ts @@ -38,6 +38,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { WidgetOnboardingComponent } from './widget-onboarding.component'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { FormsModule } from '@angular/forms'; +import { NgMaterialModule } from 'src/app/ng-material-module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('WidgetOnboardingComponent', () => { let component: WidgetOnboardingComponent; @@ -45,7 +49,8 @@ describe('WidgetOnboardingComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WidgetOnboardingComponent ] + declarations: [ WidgetOnboardingComponent ], + imports:[HttpClientTestingModule,FormsModule,NgMaterialModule,BrowserAnimationsModule], }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/pages/widgets/widgets.component.spec.ts b/portal-FE-common/src/app/pages/widgets/widgets.component.spec.ts index 72982a1c..f0aa97a1 100644 --- a/portal-FE-common/src/app/pages/widgets/widgets.component.spec.ts +++ b/portal-FE-common/src/app/pages/widgets/widgets.component.spec.ts @@ -1,6 +1,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { WidgetsComponent } from './widgets.component'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('WidgetsComponent', () => { let component: WidgetsComponent; @@ -8,7 +10,8 @@ describe('WidgetsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WidgetsComponent ] + declarations: [ WidgetsComponent ], + imports:[HttpClientTestingModule,BrowserAnimationsModule] }) .compileComponents(); })); |