diff options
author | Tao Shen <shentao@chinamobile.com> | 2019-01-29 03:19:57 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-01-29 03:19:57 +0000 |
commit | 5788be72a1515dd96d2c748d5145b8609b78a142 (patch) | |
tree | 86b0615c1bc524652d951925e8f05e29b11f5cb1 /usecaseui-portal/src | |
parent | aa4eca9829469b6b233b7032a0687e9c95d41487 (diff) | |
parent | e74efeb2acc818880a6eda2b0e17773d3ee4f750 (diff) |
Merge "Test case- performace-vm component"
Diffstat (limited to 'usecaseui-portal/src')
-rw-r--r-- | usecaseui-portal/src/app/performance/performance-vm/performance-vm.component.spec.ts | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/usecaseui-portal/src/app/performance/performance-vm/performance-vm.component.spec.ts b/usecaseui-portal/src/app/performance/performance-vm/performance-vm.component.spec.ts index fd441da3..b66b2ea0 100644 --- a/usecaseui-portal/src/app/performance/performance-vm/performance-vm.component.spec.ts +++ b/usecaseui-portal/src/app/performance/performance-vm/performance-vm.component.spec.ts @@ -1,4 +1,5 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { PerformanceVmComponent } from './performance-vm.component'; @@ -8,7 +9,10 @@ describe('PerformanceVmComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PerformanceVmComponent ] + declarations: [ PerformanceVmComponent ], + imports: [ + BrowserAnimationsModule + ] }) .compileComponents(); })); @@ -22,4 +26,43 @@ describe('PerformanceVmComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('should test performanceShow method to set proper values', () => { + component.performanceShow(); + expect(component.state).toBe('show'); + expect(component.state2).toBe('hide'); + expect(component.state3).toBe('hide'); + expect(component.graphicshow).toBe(false); + expect(component.detailshow).toBe(false); + }); + + it('should test graphicShow method to set proper values', () => { + component.graphicShow(); + expect(component.state).toBe('hide'); + expect(component.state2).toBe('show'); + expect(component.state3).toBe('hide'); + expect(component.graphicshow).toBe(true); + expect(component.detailshow).toBe(false); + }); + + it('should test detailShow method to set proper values', () => { + component.detailShow({id:1}); + expect(component.state).toBe('hide'); + expect(component.state2).toBe('hide'); + expect(component.state3).toBe('show'); + expect(component.graphicshow).toBe(true); + expect(component.detailshow).toBe(true); + expect(component.detailId).toBe(1); + }); + + it('should test choseSourceName method', () => { + component.choseSourceName('bbbb'); + expect(component.sourceNameSelected).toBe('bbbb'); + }); + + it('should test choseSourceName method', () => { + component.choseReportingEntityName('bbbb'); + expect(component.ReportingEntityNameSelected).toBe('bbbb'); + }); + }); |