import { MockBackend, MockConnection } from '@angular/http/testing';
 import { NgxSpinnerService } from 'ngx-spinner';
 import { UtilityService } from '../../../../shared/services/utilityService/utility.service';
+import { APIService } from "../../../../shared/services/cdt.apicall";
 
 
 describe('GoldenConfigurationMappingComponent', () => {
         TestBed.configureTestingModule({
             imports: [FormsModule, BrowserModule, RouterTestingModule.withRoutes(routes), HttpModule, Ng2Bs3ModalModule, SimpleNotificationsModule.forRoot()],
             declarations: [GoldenConfigurationMappingComponent, HomeComponent, TestComponent, HelpComponent, AboutUsComponent, LogoutComponent, AceEditorComponent],
-            providers: [UtilityService, BuildDesignComponent, NgProgress, ParamShareService, DialogService, NotificationService, MockBackend,
+            providers: [APIService, UtilityService, BuildDesignComponent, NgProgress, ParamShareService, DialogService, NotificationService, MockBackend,
                 HttpUtilService, MappingEditorService, NotificationsService, NgxSpinnerService,
                 BaseRequestOptions,
                 {
             "sync_auto-pop_address1": "",
             "node0_tacplus_server_name2": "192.34.45.5"
         });
+        mappingEditorService.selectedObj({
+            action: "Configure",
+            vnf: "testVnf",
+            vnfc: "",
+            protocol: "CHEF",
+            param_artifact: "param_artifact",
+            pd_artifact: "pd_artifact",
+            template_artifact: "template_artifact"
+        });
+
         expect(component.ngOnInit());
 
         expect(component.ngAfterViewInit());
         expect(component.vnfcType).toEqual('');
         expect(component.protocol).toEqual('CHEF');
 
-        expect(component.artifactName).toEqual('template_Configure_test_0.0.1V.json');
-
-        mappingEditorService.latestAction = { "action": "Configure", "action-level": "vnf", "scope": { "vnf-type": "testVnf", "vnfc-type": "testVnfc" }, "template": "Y", "vm": [], "device-protocol": "CHEF", "user-name": "", "port-number": "", "artifact-list": [{ "artifact-name": "template_Configure_test_0.0.1V.json", "artifact-type": "config_template" }, { "artifact-name": "pd_Configure_test_0.0.1V.yaml", "artifact-type": "parameter_definitions" }], "scopeType": "vnf-type" }
-        expect(component.ngOnInit());
-        expect(component.vnfcType).toEqual('testVnfc');
+        // mappingEditorService.latestAction = { "action": "Configure", "action-level": "vnf", "scope": { "vnf-type": "testVnf", "vnfc-type": "testVnfc" }, "template": "Y", "vm": [], "device-protocol": "CHEF", "user-name": "", "port-number": "", "artifact-list": [{ "artifact-name": "template_Configure_test_0.0.1V.json", "artifact-type": "config_template" }, { "artifact-name": "pd_Configure_test_0.0.1V.yaml", "artifact-type": "parameter_definitions" }], "scopeType": "vnf-type" }
+        // expect(component.ngOnInit());
+        // expect(component.vnfcType).toEqual('testVnfc');
 
 
     }));
 
         expect(spy).toHaveBeenCalled();
     });
-
-    it('should validate of the file name creation for configscaleout is correct', () => {
-        fixture = TestBed.createComponent(GoldenConfigurationMappingComponent);
-        component = fixture.componentInstance;
-
-        let fileName;
-        let expectedFileName = "param_Configure_testVnfType_0.0.1V_id1.json";
-        expect(expectedFileName).toBe(fileName);
-    });
 });
\ No newline at end of file