diff options
author | 2021-10-29 14:24:20 +0100 | |
---|---|---|
committer | 2021-10-29 15:16:06 +0100 | |
commit | ce0db169bce5d44ab36be7015a11c9a0205e05a1 (patch) | |
tree | c2b631c8e320c1528fe4b87da9d5a21eeabe41e8 /gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__ | |
parent | 6df019389c1f5de9dd5b7601e270f0ef17ea2491 (diff) |
Added tests to improve coverage
Added new tests and snapshots
Altered existing tests to bring up coverage
Altered package.json in response to warning messages
Removed unused functions from ControlLoopService
Added json testFiles
Added utils directory for out-of-component functions
Issue-ID: POLICY-3643
Change-Id: I3405a4421637e63235ff5176c913a5a5f9a4a44c
Signed-off-by: saul.gill <saul.gill@est.tech>
Diffstat (limited to 'gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__')
3 files changed, 142 insertions, 1 deletions
diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/ChangeOrderStateModal.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/ChangeOrderStateModal.test.js.snap new file mode 100644 index 0000000..478b886 --- /dev/null +++ b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/ChangeOrderStateModal.test.js.snap @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Verify ChangeOrderStateModal renders correctly 1`] = ` +<Styled(Modal) + backdrop="static" + keyboard={false} + onHide={[Function]} + show={true} + size="sm" +> + <ModalHeader + closeButton={true} + closeLabel="Close" + > + <ModalTitle> + Manage Instantiation + </ModalTitle> + </ModalHeader> + <div + style={ + Object { + "padding": "5px 5px 0 5px", + } + } + > + <ModalBody> + <Container + fluid={false} + > + <Dropdown + navbar={false} + onSelect={[Function]} + > + <DropdownToggle + id="dropdown-basic" + variant="dark" + > + Select Order State + </DropdownToggle> + <DropdownMenu + align="left" + alignRight={false} + flip={true} + > + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "render": [Function], + } + } + disabled={false} + eventKey="UNINITIALISED" + > + UNINITIALISED + </DropdownItem> + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "render": [Function], + } + } + disabled={false} + eventKey="PASSIVE" + > + PASSIVE + </DropdownItem> + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "render": [Function], + } + } + disabled={false} + eventKey="RUNNING" + > + RUNNING + </DropdownItem> + </DropdownMenu> + </Dropdown> + </Container> + <Styled(Alert) + show={false} + variant="danger" + > + Can't get instantiation ordered state: + <br /> + {} + </Styled(Alert)> + </ModalBody> + <styled.div /> + </div> + <ModalFooter> + <Button + active={false} + disabled={false} + onClick={[Function]} + variant="primary" + > + Save + </Button> + <Button + active={false} + disabled={false} + onClick={[Function]} + variant="secondary" + > + Close + </Button> + </ModalFooter> +</Styled(Modal)> +`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/CommissioningModal.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/CommissioningModal.test.js.snap index 8c26ff6..5ed3f3e 100644 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/CommissioningModal.test.js.snap +++ b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/CommissioningModal.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Verify ReadAndConvertYaml renders correctly 1`] = ` +exports[`Verify CommissioningModal renders correctly 1`] = ` <Styled(Modal) backdrop="static" keyboard={false} diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationOrderStateChangeItem.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationOrderStateChangeItem.test.js.snap new file mode 100644 index 0000000..bbf92ca --- /dev/null +++ b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationOrderStateChangeItem.test.js.snap @@ -0,0 +1,27 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Verify InstantiationOrderStateChangeItem renders correctly 1`] = `<Fragment />`; + +exports[`Verify InstantiationOrderStateChangeItem renders correctly when orderState is passive 1`] = ` +<Fragment> + <styled.div> + PASSIVE_TEST + </styled.div> +</Fragment> +`; + +exports[`Verify InstantiationOrderStateChangeItem renders correctly when orderState is running 1`] = ` +<Fragment> + <styled.div> + RUNNING_TEST + </styled.div> +</Fragment> +`; + +exports[`Verify InstantiationOrderStateChangeItem renders correctly when orderState is uninitialized 1`] = ` +<Fragment> + <styled.div> + UNINITIALISED_TEST + </styled.div> +</Fragment> +`; |