summaryrefslogtreecommitdiffstats
path: root/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.test.js
diff options
context:
space:
mode:
authorbrunomilitzer <bruno.militzer@est.tech>2021-12-17 17:41:57 +0000
committerBruno Militzer <bruno.militzer@est.tech>2022-01-04 15:51:54 +0000
commit4be96f85c65df9384b11d68e87ca9e03e27a083c (patch)
treeaf178c54ace2b5d7457e3547b81cae6f4b6d5ebc /gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.test.js
parentacd025f30f0005731c9b2894cb954bd31401ab76 (diff)
Added Jest Unit Tests
Jest Tests for creation of instance properties Jest Tests for deletion of instance properties Included Issue-Id: 3566 Issue-ID: POLICY-3563 Signed-off-by: brunomilitzer <bruno.militzer@est.tech> Change-Id: I227ae8f306df10ee3cc341791471dda9ca79d9d1
Diffstat (limited to 'gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.test.js')
-rw-r--r--gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.test.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.test.js
index 136983a..7b1c1ec 100644
--- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.test.js
+++ b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.test.js
@@ -25,9 +25,25 @@ import React from "react";
import InstantiationElementItem from "./InstantiationElementItem";
describe('Verify InstantiationElementItem', () => {
- const container = shallow(<InstantiationElementItem />);
+ const index = 0;
it("renders correctly", () => {
+ const container = shallow(<InstantiationElementItem />);
+ expect(toJson(container)).toMatchSnapshot();
+ });
+
+ it("renders correctly when orderState is uninitialized", () => {
+ const container = shallow(<InstantiationElementItem title={ "UNINITIALISED_TEST" } orderState={ "UNINITIALISED" } index={ index } key={ index }/>);
+ expect(toJson(container)).toMatchSnapshot();
+ });
+
+ it("renders correctly when orderState is passive", () => {
+ const container = shallow(<InstantiationElementItem title={ "PASSIVE_TEST" } orderState={ "PASSIVE" } index={ index } key={ index }/>);
+ expect(toJson(container)).toMatchSnapshot();
+ });
+
+ it("renders correctly when orderState is running", () => {
+ const container = shallow(<InstantiationElementItem title={ "RUNNING_TEST" } orderState={ "RUNNING" } index={ index } key={ index }/>);
expect(toJson(container)).toMatchSnapshot();
});
}); \ No newline at end of file