diff options
author | 2021-10-28 15:34:43 +0100 | |
---|---|---|
committer | 2021-10-28 15:34:53 +0100 | |
commit | 53b46adf3359b37cd83fea036c1b87f8b55683db (patch) | |
tree | 97204bb7ea1eac046f5becd62197c75084b68554 /gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.js | |
parent | a8140d3db5264bbc9dfd513c51d78951b42c6c37 (diff) |
Added JEST Unit Tests for Monitoring Functionality
Created Unit Tests to cover monitoring functionality
Issue-ID: POLICY-3561
Change-Id: I48035f3960447c66d29005d5eba2e8332c55b591
Signed-off-by: brunomilitzer <bruno.militzer@est.tech>
Diffstat (limited to 'gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.js')
-rw-r--r-- | gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.js index dad4185..4186477 100644 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.js +++ b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.js @@ -43,13 +43,13 @@ const MonitorInstantiation = (props) => { const controlLoopInstantiation = await ControlLoopService.getControlLoopInstantiation() .catch(error => error.message); - const controlLoopInstantiationJson = await controlLoopInstantiation.json() - console.log(controlLoopInstantiationJson) + const controlLoopInstantiationJson = await controlLoopInstantiation.json(); + if (!controlLoopInstantiation.ok || controlLoopInstantiationJson['controlLoopList'].length === 0) { setControlLoopInstantiationOk(false) setControlLoopInstantiationError(controlLoopInstantiationJson) } else { - setControlLoopList(controlLoopInstantiationJson[['controlLoopList']]) + setControlLoopList(controlLoopInstantiationJson['controlLoopList']); } }, []) @@ -67,7 +67,7 @@ const MonitorInstantiation = (props) => { <Modal.Body> { controlLoopList.map((clList, index) => ( - <InstantiationItem title={ clList["name"] } orderedState={ clList["orderedState"] } index={ index } key={ index }> + <InstantiationItem title={ clList["name"] } orderedState={ clList["orderedState"] } index={ index } key={ index } > <InstantiationElements elements={ clList["elements"] } /> </InstantiationItem> )) |