Skip to content

Commit 33b156e

Browse files
committed
Remove stop replication specific tests
Signed-off-by: wzyns <me@wzyns.com>
1 parent 4f13fca commit 33b156e

3 files changed

Lines changed: 1 addition & 44 deletions

File tree

public/pages/VisualCreatePolicy/containers/CreateAction/CreateAction.test.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,4 @@ describe("<CreateAction /> spec", () => {
2626
);
2727
expect(container.firstChild).toMatchSnapshot();
2828
});
29-
30-
it("includes stop replication in the action type dropdown", () => {
31-
const rolloverAction: UIAction<any> = new RolloverUIAction(DEFAULT_ROLLOVER, "some_id");
32-
const { container } = render(
33-
<CreateAction
34-
stateName="some_state"
35-
actions={[rolloverAction]}
36-
editAction={rolloverAction}
37-
onClickCancelAction={() => {}}
38-
onClickSaveAction={() => {}}
39-
/>
40-
);
41-
42-
const stopReplicationOption = container.querySelector('option[value="stop_replication"]');
43-
expect(stopReplicationOption).toBeInTheDocument();
44-
expect(stopReplicationOption).toHaveTextContent("Stop Replication");
45-
});
4629
});

public/pages/VisualCreatePolicy/containers/CreateState/CreateState.test.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,10 @@ import "@testing-library/jest-dom/extend-expect";
88
import { render } from "@testing-library/react";
99
import CreateState from "./CreateState";
1010
import { DEFAULT_POLICY } from "../../utils/constants";
11-
import { Policy, State } from "../../../../../models/interfaces";
1211

1312
describe("<CreateState /> spec", () => {
1413
it("renders the component", () => {
1514
render(<CreateState policy={DEFAULT_POLICY} onSaveState={() => {}} onCloseFlyout={() => {}} state={null} />);
1615
expect(document.body.children[1]).toMatchSnapshot();
1716
});
18-
19-
it("loads a state with a stop replication action", () => {
20-
const state: State = {
21-
name: "stop_replication",
22-
actions: [{ stop_replication: {} }],
23-
transitions: [],
24-
};
25-
const policy: Policy = {
26-
...DEFAULT_POLICY,
27-
default_state: state.name,
28-
states: [state],
29-
};
30-
31-
expect(() => render(<CreateState policy={policy} onSaveState={() => {}} onCloseFlyout={() => {}} state={state} />)).not.toThrow();
32-
});
3317
});

public/pages/VisualCreatePolicy/utils/helpers.test.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
import { actionRepoSingleton, capitalizeFirstLetter, convertTemplatesToArray, getOrderInfo, getUpdatedPolicy } from "./helpers";
77
import { Action, ISMTemplate, UIAction } from "../../../../models/interfaces";
88
import { makeId } from "../../../utils/helpers";
9-
import { DEFAULT_POLICY, DEFAULT_STOP_REPLICATION } from "./constants";
10-
import { StopReplicationUIAction } from "../components/UIActions";
9+
import { DEFAULT_POLICY } from "./constants";
1110

1211
test("converts all ism template formats into a list of ism templates", () => {
1312
expect(convertTemplatesToArray(null)).toEqual([]);
@@ -83,15 +82,6 @@ test("action repository usage", () => {
8382
expect(actionRepoSingleton.getUIActionFromData(DEFAULT_DUMMY) instanceof DummyUIAction).toBe(true);
8483
});
8584

86-
test("action repository supports stop replication action", () => {
87-
expect(actionRepoSingleton.getAllActionTypes()).toContain("stop_replication");
88-
expect(actionRepoSingleton.getUIAction("stop_replication") instanceof StopReplicationUIAction).toBe(true);
89-
expect(actionRepoSingleton.getUIActionFromData(DEFAULT_STOP_REPLICATION) instanceof StopReplicationUIAction).toBe(true);
90-
expect(actionRepoSingleton.getUIActionFromData({ stop_replication: {} }).toAction()).toEqual({
91-
stop_replication: {},
92-
});
93-
});
94-
9585
test("changing the default state name correctly updates default_state", () => {
9686
const policy = DEFAULT_POLICY;
9787
const updatedState = { ...policy.states[0], name: "new_hot" };

0 commit comments

Comments
 (0)