2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
23 import React from 'react';
24 import { shallow } from 'enzyme';
25 import LoopStatus from './LoopStatus';
26 import LoopCache from '../../../api/LoopCache';
28 describe('Verify LoopStatus', () => {
30 const loopCache = new LoopCache({
31 "name": "LOOP_Jbv1z_v1_0_ResourceInstanceName1_tca",
32 "lastComputedState": "DESIGN",
36 "stateName": "NOT_SENT",
37 "description": "The policies defined have NOT yet been created on the policy engine"
42 "stateName": "BLUEPRINT_DEPLOYED",
43 "description": "The DCAE blueprint has been found in the DCAE inventory but not yet instancianted for this loop"
49 it('Test the render method', () => {
50 const component = shallow(<LoopStatus loopCache={loopCache}/>)
52 expect(component).toMatchSnapshot();
54 const loopCacheUpdated = new LoopCache({
55 "name": "LOOP_Jbv1z_v1_0_ResourceInstanceName1_tca",
56 "lastComputedState": "SUBMIT",
61 "description": "The policies defined have NOT yet been created on the policy engine"
66 "stateName": "BLUEPRINT_DEPLOYED",
67 "description": "The DCAE blueprint has been found in the DCAE inventory but not yet instancianted for this loop"
72 component.setProps({ loopCache: loopCacheUpdated });
74 const forms = component.find('TableRow');
75 expect(forms.get(0).props.statusRow.stateName).toEqual("SENT");
76 expect(component.find('label').text()).toContain('SUBMIT');