Add react ui tests
[clamp.git] / ui-react / src / components / loop_viewer / status / LoopStatus.test.js
index 2be825e..8d04487 100644 (file)
@@ -50,5 +50,29 @@ describe('Verify LoopStatus', () => {
                const component = shallow(<LoopStatus loopCache={loopCache}/>)
 
                expect(component).toMatchSnapshot();
+               
+               const loopCacheUpdated = new LoopCache({
+                       "name": "LOOP_Jbv1z_v1_0_ResourceInstanceName1_tca",
+                       "lastComputedState": "SUBMIT",
+                       "components": {
+                               "POLICY": {
+                                       "componentState": {
+                                               "stateName": "SENT",
+                                               "description": "The policies defined have NOT yet been created on the policy engine"
+                                       }
+                               },
+                               "DCAE": {
+                                       "componentState": {
+                                               "stateName": "BLUEPRINT_DEPLOYED",
+                                               "description": "The DCAE blueprint has been found in the DCAE inventory but not yet instancianted for this loop"
+                                       }
+                               }
+                       }
+               });
+               component.setProps({ loopCache: loopCacheUpdated });
+
+               const forms = component.find('TableRow');
+               expect(forms.get(0).props.statusRow.stateName).toEqual("SENT");
+               expect(component.find('label').text()).toContain('SUBMIT');
        });
 });
\ No newline at end of file