aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/vnfs/build-artifacts
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2018-09-10 14:13:16 +0530
committerIBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com>2018-09-10 14:13:32 +0530
commit840ad7e75cb0526fd53c36af8eb2a8508eff60dd (patch)
tree3905965944c2b7354e61387408f0666cb12adffa /src/app/vnfs/build-artifacts
parent6a47abc7c6e9a38fa99f86620a4cd9fd1b324070 (diff)
reference-dataform.component- added test case
Wrote test case to test and cover displayHandleVnfc() function Issue-ID: APPC-1064 Change-Id: I0bc81df5c458d44cc044cad60967c0a051f82af0 Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'src/app/vnfs/build-artifacts')
-rw-r--r--src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts
index a3d87d2..e69b8f8 100644
--- a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts
+++ b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts
@@ -47,6 +47,7 @@ describe('ReferenceDataformComponent', () => {
let component: ReferenceDataformComponent;
let fixture: ComponentFixture<ReferenceDataformComponent>;
let service: MockMappingService;
+ let originalTimeout;
let httpMock: HttpUtilService
//mockingthe data for mappingEditorService
@@ -121,6 +122,8 @@ describe('ReferenceDataformComponent', () => {
}
class MockreferenceDataObject { }
beforeEach(async(() => {
+ // originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
+ // jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
TestBed.configureTestingModule({
declarations: [ReferenceDataformComponent],
schemas: [NO_ERRORS_SCHEMA],
@@ -1084,4 +1087,28 @@ describe('ReferenceDataformComponent', () => {
expect(component.errorMessage).toBe('');
expect(component.invalid).toBe(false);
});
+
+ it('should test displayHideVnfc function', inject([MappingEditorService], (service: MappingEditorService) => {
+ component.referenceDataObject = {
+ action: 'ConfigScaleOut',
+ 'action-level': 'vnf',
+ scope: {
+ 'vnf-type': '',
+ 'vnfc-type-list': ['346']
+ },
+ 'template': 'Y',
+ vm: [],
+ 'device-protocol': '',
+ 'user-name': '',
+ 'port-number': '',
+ 'artifact-list': []
+ };
+ service.newObject = { vnfc: false};
+ component.displayHideVnfc();
+ expect(component.vnfcIdentifier).toBe('346');
+ }));
+
+ // afterEach(function() {
+ // jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
+ // });
}); \ No newline at end of file