diff options
author | Avi Ziv <avi.ziv@amdocs.com> | 2017-07-18 19:45:38 +0300 |
---|---|---|
committer | Avi Ziv <avi.ziv@amdocs.com> | 2017-07-18 19:45:38 +0300 |
commit | b8e2faf476202b6ffe61bc3a9a37df1304881d40 (patch) | |
tree | f78b8c0517d8e16c5ae610bf8b49f68ea8a312a1 /openecomp-ui/test/softwareProduct/components/monitoring/SoftwareProductComponentsMonitoring.test.js | |
parent | 75aacbbe1acf78fa53378f07f0a8c7769449a17e (diff) |
[SDC] Onboarding 1710 rebase.
Change-Id: If3b6b81d221fde13908f1e8160db6f7d9433c535
Signed-off-by: Avi Ziv <avi.ziv@amdocs.com>
Diffstat (limited to 'openecomp-ui/test/softwareProduct/components/monitoring/SoftwareProductComponentsMonitoring.test.js')
-rw-r--r-- | openecomp-ui/test/softwareProduct/components/monitoring/SoftwareProductComponentsMonitoring.test.js | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/openecomp-ui/test/softwareProduct/components/monitoring/SoftwareProductComponentsMonitoring.test.js b/openecomp-ui/test/softwareProduct/components/monitoring/SoftwareProductComponentsMonitoring.test.js index 24658f1b30..423a7b39f6 100644 --- a/openecomp-ui/test/softwareProduct/components/monitoring/SoftwareProductComponentsMonitoring.test.js +++ b/openecomp-ui/test/softwareProduct/components/monitoring/SoftwareProductComponentsMonitoring.test.js @@ -19,11 +19,12 @@ import TestUtils from 'react-addons-test-utils'; import {mapStateToProps} from 'sdc-app/onboarding/softwareProduct/components/monitoring/SoftwareProductComponentsMonitoring.js'; import SoftwareProductComponentsMonitoringView from 'sdc-app/onboarding/softwareProduct/components/monitoring/SoftwareProductComponentsMonitoringView.jsx'; -import {VSPComponentsMonitoringViewFactory} from 'test-utils/factories/softwareProduct/SoftwareProductComponentsMonitoringFactories.js'; +import {VSPComponentsMonitoringViewFactory, trap, poll, ves} from 'test-utils/factories/softwareProduct/SoftwareProductComponentsMonitoringFactories.js'; import VersionControllerUtilsFactory from 'test-utils/factories/softwareProduct/VersionControllerUtilsFactory.js'; const version = VersionControllerUtilsFactory.build(); + describe('SoftwareProductComponentsMonitoring Module Tests', function () { it('should mapper exist', () => { @@ -33,24 +34,36 @@ describe('SoftwareProductComponentsMonitoring Module Tests', function () { it('should return empty file names', () => { let softwareProduct = {softwareProductEditor: {data: {...version}}, softwareProductComponents: {monitoring: {}}}; var results = mapStateToProps({softwareProduct}); - expect(results.trapFilename).toEqual(undefined); - expect(results.pollFilename).toEqual(undefined); + expect(results.filenames[trap]).toEqual(undefined); + expect(results.filenames[poll]).toEqual(undefined); + expect(results.filenames[ves]).toEqual(undefined); }); it('should return trap file name', () => { - const monitoring = VSPComponentsMonitoringViewFactory.build({}, {snmpTrapFlag: true}); + const monitoring = VSPComponentsMonitoringViewFactory.build({}, {createTrap: true}); + let softwareProduct = {softwareProductEditor: {data: {...version}}, softwareProductComponents: {monitoring}}; + var results = mapStateToProps({softwareProduct}); + expect(results.filenames[trap]).toEqual(monitoring[trap]); + expect(results.filenames[poll]).toEqual(undefined); + expect(results.filenames[ves]).toEqual(undefined); + }); + + it('should return ves events file name', () => { + const monitoring = VSPComponentsMonitoringViewFactory.build({}, {createVes: true}); let softwareProduct = {softwareProductEditor: {data: {...version}}, softwareProductComponents: {monitoring}}; var results = mapStateToProps({softwareProduct}); - expect(results.trapFilename).toEqual(monitoring.trapFilename); - expect(results.pollFilename).toEqual(undefined); + expect(results.filenames[ves]).toEqual(monitoring[ves]); + expect(results.filenames[poll]).toEqual(undefined); + expect(results.filenames[trap]).toEqual(undefined); }); it('should return poll file names', () => { - const monitoring = VSPComponentsMonitoringViewFactory.build({}, {snmpPollFlag: true}); + const monitoring = VSPComponentsMonitoringViewFactory.build({}, {createPoll: true}); let softwareProduct = {softwareProductEditor: {data: {...version}}, softwareProductComponents: {monitoring}}; var results = mapStateToProps({softwareProduct}); - expect(results.trapFilename).toEqual(undefined); - expect(results.pollFilename).toEqual(monitoring.pollFilename); + expect(results.filenames[poll]).toEqual(monitoring[poll]); + expect(results.filenames[trap]).toEqual(undefined); + expect(results.filenames[ves]).toEqual(undefined); let renderer = TestUtils.createRenderer(); renderer.render(<SoftwareProductComponentsMonitoringView {...results} />); @@ -58,12 +71,13 @@ describe('SoftwareProductComponentsMonitoring Module Tests', function () { expect(renderedOutput).toBeTruthy(); }); - it('should return both file names', () => { - const monitoring = VSPComponentsMonitoringViewFactory.build({}, {snmpTrapFlag: true, snmpPollFlag: true}); + it('should return all file names', () => { + const monitoring = VSPComponentsMonitoringViewFactory.build({}, {createTrap: true, createVes: true, createPoll: true}); let softwareProduct = {softwareProductEditor: {data: {...version}}, softwareProductComponents: {monitoring}}; var results = mapStateToProps({softwareProduct}); - expect(results.trapFilename).toEqual(monitoring.trapFilename); - expect(results.pollFilename).toEqual(monitoring.pollFilename); + expect(results.filenames[poll]).toEqual(monitoring[poll]); + expect(results.filenames[trap]).toEqual(monitoring[trap]); + expect(results.filenames[ves]).toEqual(monitoring[ves]); let renderer = TestUtils.createRenderer(); renderer.render(<SoftwareProductComponentsMonitoringView {...results} />); |