aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/dialogs/Policy/PolicyModal.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui-react/src/components/dialogs/Policy/PolicyModal.test.js')
-rw-r--r--ui-react/src/components/dialogs/Policy/PolicyModal.test.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/ui-react/src/components/dialogs/Policy/PolicyModal.test.js b/ui-react/src/components/dialogs/Policy/PolicyModal.test.js
index cb0a32020..1e6fac0a0 100644
--- a/ui-react/src/components/dialogs/Policy/PolicyModal.test.js
+++ b/ui-react/src/components/dialogs/Policy/PolicyModal.test.js
@@ -1,8 +1,8 @@
/*-
* ============LICENSE_START=======================================================
- * ONAP CLAMP
+ * ONAP POLICY-CLAMP
* ================================================================================
- * Copyright (C) 2020 AT&T Intellectual Property. All rights
+ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,6 +26,7 @@ import PolicyModal from './PolicyModal';
import LoopCache from '../../../api/LoopCache';
import LoopService from '../../../api/LoopService';
import OnapConstant from '../../../utils/OnapConstants';
+import { shallow } from 'enzyme';
describe('Verify PolicyModal', () => {
beforeEach(() => {
@@ -52,11 +53,12 @@ describe('Verify PolicyModal', () => {
"jsonRepresentation" : {"schema": {}}
}]
};
+
const loopCache = new LoopCache(loopCacheStr);
const historyMock = { push: jest.fn() };
const flushPromises = () => new Promise(setImmediate);
const match = {params: {policyName:"OPERATIONAL_h2NMX_v1_0_ResourceInstanceName1_tca", policyInstanceType: OnapConstant.operationalPolicyType}}
-
+
it('Test handleClose', () => {
const handleClose = jest.spyOn(PolicyModal.prototype,'handleClose');
const component = mount(<PolicyModal history={historyMock} match={match} loopCache={loopCache}/>)
@@ -125,4 +127,9 @@ describe('Verify PolicyModal', () => {
instance.handlePdpSubgroupChange(event);
expect(component.state('chosenPdpSubgroup')).toEqual("option1");
});
+
+ it('Test the render method', () => {
+ const component = shallow(<PolicyModal loopCache={loopCache} match={match}/>)
+ expect(component).toMatchSnapshot();
+ });
}); \ No newline at end of file