diff options
Diffstat (limited to 'runtime/ui-react/src/components/dialogs/Policy/ToscaViewer.test.js')
-rw-r--r-- | runtime/ui-react/src/components/dialogs/Policy/ToscaViewer.test.js | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/runtime/ui-react/src/components/dialogs/Policy/ToscaViewer.test.js b/runtime/ui-react/src/components/dialogs/Policy/ToscaViewer.test.js index cc8c59a03..5b5976046 100644 --- a/runtime/ui-react/src/components/dialogs/Policy/ToscaViewer.test.js +++ b/runtime/ui-react/src/components/dialogs/Policy/ToscaViewer.test.js @@ -26,29 +26,29 @@ import { shallow, mount } from 'enzyme'; import PolicyToscaService from '../../../api/PolicyToscaService'; describe('Verify ToscaViewer', () => { - const fs = require('fs'); + const fs = require('fs'); - let toscaYaml = fs.readFileSync('src/components/dialogs/Policy/toscaData.test.yaml', {encoding:'utf8', flag:'r'}) + let toscaYaml = fs.readFileSync('src/components/dialogs/Policy/toscaData.test.yaml', { encoding: 'utf8', flag: 'r' }) - const toscaData = { - "policyModelType": "onap.policies.controlloop.Guard", - "version": "1.0.0", - "policyAcronym": "Guard", - "createdDate": "2021-04-09T02:29:31.407356Z", - "updatedDate": "2021-04-09T02:29:31.407356Z", - "updatedBy": "Not found", - "createdBy": "Not found", - "tableData": { - "id": 0 - } - }; + const toscaData = { + "policyModelType": "onap.policies.controlloop.Guard", + "version": "1.0.0", + "policyAcronym": "Guard", + "createdDate": "2021-04-09T02:29:31.407356Z", + "updatedDate": "2021-04-09T02:29:31.407356Z", + "updatedBy": "Not found", + "createdBy": "Not found", + "tableData": { + "id": 0 + } + }; - it('Test the render method',async () => { - PolicyToscaService.getToscaPolicyModelYaml = jest.fn().mockImplementation(() => { - return Promise.resolve(toscaYaml); - }); - const component = shallow(<ToscaViewer toscaData={toscaData}/>); - await PolicyToscaService.getToscaPolicyModelYaml(); - expect(component).toMatchSnapshot(); - }); + it('Test the render method', async () => { + PolicyToscaService.getToscaPolicyModelYaml = jest.fn().mockImplementation(() => { + return Promise.resolve(toscaYaml); + }); + const component = shallow(<ToscaViewer toscaData={ toscaData }/>); + await PolicyToscaService.getToscaPolicyModelYaml(); + expect(component).toMatchSnapshot(); + }); }); |