diff --git a/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationActionHelper.test.js b/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationActionHelper.test.js
index ee6ba90..0a8f640 100644
--- a/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationActionHelper.test.js
+++ b/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationActionHelper.test.js
@@ -26,83 +26,193 @@
 import { VSPCertificationCheckedFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
 import { VSPChecksFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
 import { VSPTestsMapFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
+import { VSPTestsRequestFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
+import { VSPGeneralInfoFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
+import { VSPTestResultsSuccessFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationResultsFactory.js';
+import { mapActionsToProps } from 'sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidation.js';
 
 describe('Software Product Validation Action Helper Tests', function() {
-    it('Software Products Validation Action Helper : Dsspatch', () => {
-        const store = storeCreator();
-        deepFreeze(store.getState());
+    const store = storeCreator();
+    deepFreeze(store.getState());
 
-        const vspChecksList = VSPChecksFactory.build();
-        const vspTestsMap = VSPTestsMapFactory.build();
-        const certificationChecked = VSPCertificationCheckedFactory.build();
-        const complianceChecked = VSPComplianceCheckedFactory.build();
-        const activeTab = { activeTab: tabsMapping.INPUTS };
-        const errorMessage = { msg: 'Test Error Message' };
+    const vspChecksList = VSPChecksFactory.build();
+    const vspTestsMap = VSPTestsMapFactory.build();
+    const certificationChecked = VSPCertificationCheckedFactory.build();
+    const complianceChecked = VSPComplianceCheckedFactory.build();
+    const activeTab = { activeTab: tabsMapping.INPUTS };
+    const errorMessage = { msg: 'Test Error Message' };
+    const testsRequest = VSPTestsRequestFactory.build();
+    const generalInfo = VSPGeneralInfoFactory.build();
+    const isValidationDisabled = false;
+    const vspTestResults = VSPTestResultsSuccessFactory.build();
+    let restPrefix = Configuration.get('restPrefix');
+    let onClose = () => {};
 
-        deepFreeze(vspChecksList);
-        deepFreeze(vspTestsMap);
-        deepFreeze(certificationChecked);
-        deepFreeze(complianceChecked);
-        deepFreeze(activeTab);
+    const modal = {
+        type: 'error',
+        title: 'Error',
+        modalComponentName: 'Error',
+        modalComponentProps: {
+            onClose: onClose
+        },
+        msg: {
+            msg: 'Test Error Message'
+        },
+        cancelButtonText: 'OK'
+    };
+    // deepFreeze(vspTestsMap.vspTestsMap);
+    // deepFreeze(certificationChecked.certificationChecked);
+    // deepFreeze(complianceChecked.complianceChecked);
+    // deepFreeze(activeTab);
+    // deepFreeze(testsRequest);
+    // deepFreeze(generalInfo.generalInfo);
+    // deepFreeze(isVspValidationDisabled);
 
+    it('Software Products Validation Action Helper : fetch vsp', () => {
         let expectedStore = cloneAndSet(
             store.getState(),
             'softwareProduct.softwareProductValidation.vspChecks',
             vspChecksList
         );
-        expectedStore = cloneAndSet(
-            store.getState(),
-            'softwareProduct.softwareProductValidation.vspTestsMap',
-            vspTestsMap
-        );
-        expectedStore = cloneAndSet(
-            store.getState(),
-            'softwareProduct.softwareProductValidation.certificationChecked',
-            certificationChecked
-        );
-        expectedStore = cloneAndSet(
-            store.getState(),
-            'softwareProduct.softwareProductValidation.complianceChecked',
-            complianceChecked
-        );
-        expectedStore = cloneAndSet(
-            store.getState(),
-            'softwareProduct.softwareProductValidation.activeTab',
-            activeTab
-        );
-        let restPrefix = Configuration.get('restPrefix');
-
-        mockRest.addHandler('fetch', ({ options, data, baseUrl }) => {
-            expect(baseUrl).toEqual(`${restPrefix}/v1.0/externaltesting`);
-            expect(data).toEqual(undefined);
-            expect(options).toEqual(undefined);
-            return { vspChecks: vspChecksList };
+        mockRest.addHandler('fetch', ({ baseUrl }) => {
+            expect(baseUrl).toEqual(
+                `${restPrefix}/v1.0/externaltesting/testcasetree`
+            );
+            return vspChecksList;
         });
-
-        SoftwareProductValidationActionHelper.setVspTestsMap(store.dispatch, {
-            vspTestsMap
-        });
-        SoftwareProductValidationActionHelper.setComplianceChecked(
-            store.dispatch,
-            { complianceChecked }
-        );
-        SoftwareProductValidationActionHelper.setCertificationChecked(
-            store.dispatch,
-            { certificationChecked }
-        );
-
-        SoftwareProductValidationActionHelper.setActiveTab(store.dispatch, {
-            activeTab
-        });
-
-        SoftwareProductValidationActionHelper.onErrorThrown(store.dispatch, {
-            errorMessage
-        });
-
-        SoftwareProductValidationActionHelper.fetchVspChecks(store.dispatch)
+        return SoftwareProductValidationActionHelper.fetchVspChecks(
+            store.dispatch
+        )
             .then(() => {
                 expect(store.getState()).toEqual(expectedStore);
             })
-            .catch(() => {});
+            .catch(() => {
+                console.log('Fetch VSP returned Error');
+            });
+    });
+
+    // it('Software Products Validation Action Helper : post test', () => {
+    //     mockRest.addHandler('post', ({ options, data, baseUrl }) => {
+    //         expect(baseUrl).toEqual(
+    //             `${restPrefix}/v1.0/externaltesting/executions`
+    //         );
+    //         //expect(data).toEqual(testsRequest);
+    //         expect(options).toEqual(undefined);
+    //         return { vspTestResults: vspTestResults };
+    //     });
+    //     const version = {
+    //         id: 12345,
+    //         name: 1
+    //     };
+    //     const softwareProductId = '1234';
+    //     const status = 'draft';
+    //     mapActionsToProps(store.dispatch).onTestSubmit(
+    //         softwareProductId,
+    //         version,
+    //         status,
+    //         testsRequest
+    //     );
+    // });
+
+    it('Software Products Validation Action Helper : setCertificationChecked', () => {
+        let expectedStore = cloneAndSet(
+            store.getState(),
+            'softwareProduct.softwareProductValidation.certificationChecked',
+            certificationChecked.certificationChecked
+        );
+        mapActionsToProps(store.dispatch).setCertificationChecked({
+            checked: certificationChecked.certificationChecked
+        });
+        expect(store.getState()).toEqual(expectedStore);
+    });
+
+    it('Software Products Validation Action Helper : onErrorThrown', () => {
+        let expectedStore = cloneAndSet(store.getState(), 'modal', modal);
+        mapActionsToProps(store.dispatch).onErrorThrown(errorMessage);
+        expect(JSON.stringify(store.getState())).toEqual(
+            JSON.stringify(expectedStore)
+        );
+    });
+
+    it('Software Products Validation Action Helper : setComplianceChecked', () => {
+        let expectedStore = cloneAndSet(
+            store.getState(),
+            'softwareProduct.softwareProductValidation.complianceChecked',
+            complianceChecked.complianceChecked
+        );
+        mapActionsToProps(store.dispatch).setComplianceChecked({
+            checked: complianceChecked.complianceChecked
+        });
+        expect(store.getState()).toEqual(expectedStore);
+    });
+
+    it('Software Products Validation Action Helper : setActiveTab', () => {
+        let expectedStore = cloneAndSet(
+            store.getState(),
+            'softwareProduct.softwareProductValidation.activeTab',
+            activeTab.activeTab
+        );
+        mapActionsToProps(store.dispatch).setActiveTab(activeTab);
+        expect(store.getState()).toEqual(expectedStore);
+    });
+
+    it('Software Products Validation Action Helper : setGeneralInfo', () => {
+        let expectedStore = cloneAndSet(
+            store.getState(),
+            'softwareProduct.softwareProductValidation.generalInfo',
+            generalInfo.generalInfo
+        );
+        mapActionsToProps(store.dispatch).setGeneralInfo(
+            generalInfo.generalInfo
+        );
+        expect(store.getState()).toEqual(expectedStore);
+    });
+
+    it('Software Products Validation Action Helper : setIsVspValidationDisabled', () => {
+        let expectedStore = cloneAndSet(
+            store.getState(),
+            'softwareProduct.softwareProductValidation.isValidationDisabled',
+            isValidationDisabled
+        );
+        SoftwareProductValidationActionHelper.setIsVspValidationDisabled(
+            store.dispatch,
+            {
+                isValidationDisabled
+            }
+        );
+        expect(store.getState()).toEqual(expectedStore);
+    });
+
+    it('Software Products Validation Action Helper : setTestsRequest', () => {
+        let expectedStore = cloneAndSet(
+            store.getState(),
+            'softwareProduct.softwareProductValidation.testsRequest',
+            testsRequest.testsRequest
+        );
+        expectedStore = cloneAndSet(
+            expectedStore,
+            'softwareProduct.softwareProductValidation.generalInfo',
+            generalInfo.generalInfo
+        );
+
+        mapActionsToProps(store.dispatch).setTestsRequest(
+            testsRequest.testsRequest,
+            generalInfo.generalInfo
+        );
+        expect(store.getState()).toEqual(expectedStore);
+    });
+
+    it('Software Products Validation Action Helper : setVspTestsMap', () => {
+        let expectedStore = cloneAndSet(
+            store.getState(),
+            'softwareProduct.softwareProductValidation.vspTestsMap',
+            vspTestsMap.vspTestsMap
+        );
+        SoftwareProductValidationActionHelper.setVspTestsMap(
+            store.dispatch,
+            vspTestsMap.vspTestsMap
+        );
+
+        expect(store.getState()).toEqual(expectedStore);
     });
 });
diff --git a/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationInputView.test.js b/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationInputView.test.js
index aa00a5d..68a8cdd 100644
--- a/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationInputView.test.js
+++ b/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationInputView.test.js
@@ -19,6 +19,7 @@
 
 import VspValidationInputsView from 'sdc-app/onboarding/softwareProduct/validation/inputs/VspValidationInputsView.jsx';
 import TestUtils from 'react-dom/test-utils';
+import { storeCreator } from 'sdc-app/AppStore.js';
 
 import { VSPComplianceCheckedFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
 import { VSPCertificationCheckedFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
@@ -26,6 +27,7 @@
 import { VSPTestsMapFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
 import { VSPTestsRequestFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
 import { VSPGeneralInfoFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
+import { mapActionsToProps } from 'sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidation.js';
 
 describe('SoftwareProductValidation Mapper and View Classes', () => {
     it('mapStateToProps mapper exists', () => {
@@ -76,22 +78,39 @@
         const status = 'draft';
 
         var obj = {
-            version: version,
-            softwareProductId: softwareProductId,
-            status: status,
-            softwareProductValidation: {
-                complianceChecked: complianceChecked.complianceChecked,
-                certificationChecked: certificationChecked.certificationChecked,
-                vspTestsMap: vspTestsMap.vspTestsMap,
-                vspChecks: vspChecksList,
-                testsRequest: testsRequest.testsRequest,
-                generalInfo: generalInfo.generalInfo
+            softwareProduct: {
+                version: version,
+                softwareProductId: softwareProductId,
+                status: status,
+                softwareProductValidation: {
+                    complianceChecked: complianceChecked.complianceChecked,
+                    certificationChecked:
+                        certificationChecked.certificationChecked,
+                    vspTestsMap: vspTestsMap.vspTestsMap,
+                    vspChecks: vspChecksList,
+                    testsRequest: testsRequest.testsRequest,
+                    generalInfo: generalInfo.generalInfo
+                }
             }
         };
+        const store = storeCreator();
+        let dispatch = store.dispatch;
+        let props = Object.assign(
+            {},
+            mapStateToProps(obj),
+            mapActionsToProps(dispatch)
+        );
 
         let vspValidationInputView = TestUtils.renderIntoDocument(
-            <VspValidationInputsView {...obj} />
+            <VspValidationInputsView {...props} />
         );
         expect(vspValidationInputView).toBeTruthy();
+
+        let inputForm = TestUtils.findRenderedDOMComponentWithTag(
+            vspValidationInputView,
+            'form'
+        );
+        expect(inputForm).toBeTruthy();
+        TestUtils.Simulate.submit(inputForm);
     });
 });
diff --git a/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationView.test.js b/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationView.test.js
index 640f9f6..be84f15 100644
--- a/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationView.test.js
+++ b/openecomp-ui/test/softwareProduct/validation/SoftwareProductValidationView.test.js
@@ -24,10 +24,11 @@
 import { VSPComplianceCheckedFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
 import { VSPCertificationCheckedFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
 import { VSPChecksFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
+import { VSPGeneralInfoFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
 import { VSPTestsMapFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
 import { tabsMapping } from 'sdc-app/onboarding/softwareProduct/validation/SoftwareProductValidationConstants.js';
 import TestUtils from 'react-dom/test-utils';
-//import { scryRenderedDOMComponentsWithTestId } from 'test-utils/Util.js';
+import { scryRenderedDOMComponentsWithTestId } from 'test-utils/Util.js';
 
 describe('SoftwareProductValidation Mapper and View Classes', () => {
     it('mapStateToProps mapper exists', () => {
@@ -43,15 +44,18 @@
         const vspTestsMap = VSPTestsMapFactory.build();
         const certificationChecked = VSPCertificationCheckedFactory.build();
         const complianceChecked = VSPComplianceCheckedFactory.build();
+        const generalInfo = VSPGeneralInfoFactory.build();
 
         var obj = {
             softwareProduct: {
                 softwareProductValidation: {
                     vspChecks: vspChecksList,
                     vspTestsMap: vspTestsMap.vspTestsMap,
-                    certificationChecked: certificationChecked.certificationChecked,
+                    certificationChecked:
+                        certificationChecked.certificationChecked,
                     complianceChecked: complianceChecked.complianceChecked,
-                    activeTab: tabsMapping.SETUP
+                    activeTab: tabsMapping.SETUP,
+                    generalInfo: generalInfo.generalInfo
                 }
             }
         };
@@ -65,6 +69,7 @@
             results.softwareProductValidation.complianceChecked
         ).toBeTruthy();
         expect(results.softwareProductValidation.activeTab).toBeTruthy();
+        expect(results.softwareProductValidation.generalInfo).toBeTruthy();
     });
 
     it('SoftwareProductValidationView render test', () => {
@@ -72,51 +77,63 @@
         const vspTestsMap = VSPTestsMapFactory.build();
         const certificationChecked = VSPCertificationCheckedFactory.build();
         const complianceChecked = VSPComplianceCheckedFactory.build();
-        let dummyFunc = () => {};
+        // let dummyFunc = () => {};
         const version = {
+            id: 12345,
             name: 1
         };
         const softwareProductId = '1234';
         const status = 'draft';
         var obj = {
-            version: version,
-            softwareProductId: softwareProductId,
-            status: status,
-            softwareProductValidation: {
-                vspChecks: vspChecksList,
-                vspTestsMap: vspTestsMap,
-                certificationChecked: certificationChecked.certificationChecked,
-                complianceChecked: complianceChecked.complianceChecked,
-                activeTab: tabsMapping.SETUP
+            softwareProduct: {
+                version: version,
+                softwareProductId: softwareProductId,
+                status: status,
+                softwareProductValidation: {
+                    vspChecks: vspChecksList,
+                    vspTestsMap: vspTestsMap.vspTestsMap,
+                    certificationChecked:
+                        certificationChecked.certificationChecked,
+                    complianceChecked: complianceChecked.complianceChecked,
+                    activeTab: tabsMapping.SETUP
+                }
             }
         };
+
         const store = storeCreator();
+        let dispatch = store.dispatch;
+
+        let props = Object.assign(
+            {},
+            mapStateToProps(obj),
+            mapActionsToProps(dispatch)
+        );
+
         let softwareProductValidationView = TestUtils.renderIntoDocument(
             <Provider store={store}>
-                <SoftwareProductValidationView
-                    {...obj}
-                    onErrorThrown={dummyFunc}
-                    onTestSubmit={dummyFunc}
-                    setVspTestsMap={dummyFunc}
-                    setActiveTab={dummyFunc}
-                    setComplianceChecked={dummyFunc}
-                    setCertificationChecked={dummyFunc}
-                />
+                <SoftwareProductValidationView {...props} />
             </Provider>
         );
 
         expect(softwareProductValidationView).toBeTruthy();
 
-        // let goToInput = scryRenderedDOMComponentsWithTestId(
-        //     softwareProductValidationView,
-        //     'go-to-inputs'
-        // );
-        // expect(goToInput).toBeTruthy();
+        let goToInput = scryRenderedDOMComponentsWithTestId(
+            softwareProductValidationView,
+            'go-to-vsp-validation-inputs'
+        );
+        expect(goToInput).toBeTruthy();
         // TestUtils.Simulate.click(goToInput[0]);
-        // let goToInput = TestUtils.findRenderedDOMComponentWithClass(
+        // expect(
+        //     store.getState().softwareProduct.softwareProductValidation.activeTab
+        // ).toBe(tabsMapping.INPUTS);
+        // let goToSetup = scryRenderedDOMComponentsWithTestId(
         //     softwareProductValidationView,
-        //     'go-to-inputs-btn'
+        //     'go-to-vsp-validation-setup'
         // );
-        // TestUtils.Simulate.click(goToInput);
+        // expect(goToSetup).toBeTruthy();
+        // TestUtils.Simulate.click(goToSetup[0]);
+        // expect(
+        //     store.getState().softwareProduct.softwareProductValidation.activeTab
+        // ).toBe(tabsMapping.SETUP);
     });
 });
diff --git a/openecomp-ui/test/softwareProduct/validationResults/SoftwareProductValidationResultsView.test.js b/openecomp-ui/test/softwareProduct/validationResults/SoftwareProductValidationResultsView.test.js
index b2cc2c0..67e9fcf 100644
--- a/openecomp-ui/test/softwareProduct/validationResults/SoftwareProductValidationResultsView.test.js
+++ b/openecomp-ui/test/softwareProduct/validationResults/SoftwareProductValidationResultsView.test.js
@@ -19,6 +19,8 @@
 import SoftwareProductValidationResultsView from 'sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsView.jsx';
 import { VSPTestResultsSuccessFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationResultsFactory.js';
 import { VSPTestResultsFailureFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationResultsFactory.js';
+import { VSPTestsMapFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationFactory.js';
+
 import TestUtils from 'react-dom/test-utils';
 
 describe('SoftwareProductValidationResults Mapper and View Classes', () => {
@@ -28,11 +30,13 @@
 
     it('mapStateToProps fail data test', () => {
         const vspTestResults = VSPTestResultsFailureFactory.build();
+        const vspTestsMap = VSPTestsMapFactory.build();
 
         var obj = {
             softwareProduct: {
                 softwareProductValidation: {
-                    vspTestResults: vspTestResults.vspTestResults
+                    vspTestResults: vspTestResults.vspTestResults,
+                    vspTestsMap: vspTestsMap.vspTestsMap
                 }
             }
         };
@@ -42,11 +46,13 @@
 
     it('mapStateToProps success data test', () => {
         const vspTestResults = VSPTestResultsSuccessFactory.build();
+        const vspTestsMap = VSPTestsMapFactory.build();
 
         var obj = {
             softwareProduct: {
                 softwareProductValidation: {
-                    vspTestResults: vspTestResults.vspTestResults
+                    vspTestResults: vspTestResults.vspTestResults,
+                    vspTestsMap: vspTestsMap.vspTestsMap
                 }
             }
         };
@@ -56,6 +62,7 @@
 
     it('SoftwareProductValidationResultsView test fail render test', () => {
         const vspTestResults = VSPTestResultsFailureFactory.build();
+        const vspTestsMap = VSPTestsMapFactory.build();
 
         const version = {
             name: 1
@@ -65,7 +72,8 @@
             softwareProductId: softwareProductId,
             version: version,
             softwareProductValidation: {
-                vspTestResults: vspTestResults.vspTestResults
+                vspTestResults: vspTestResults.vspTestResults,
+                vspTestsMap: vspTestsMap.vspTestsMap
             }
         };
         let vspValidationResultsView = TestUtils.renderIntoDocument(
@@ -76,6 +84,7 @@
 
     it('SoftwareProductValidationResultsView test success render test', () => {
         const vspTestResults = VSPTestResultsSuccessFactory.build();
+        const vspTestsMap = VSPTestsMapFactory.build();
 
         let version = {
             name: 1
@@ -85,7 +94,8 @@
             softwareProductId: softwareProductId,
             version: version,
             softwareProductValidation: {
-                vspTestResults: vspTestResults.vspTestResults
+                vspTestResults: vspTestResults.vspTestResults,
+                vspTestsMap: vspTestsMap.vspTestsMap
             }
         };
         let vspValidationResultsView = TestUtils.renderIntoDocument(
