import { moveThisByThat, changeState } from "./actions"; import { ComponentTypes } from "@sc/plugins/webcomponents/v2/types"; import { EditorObjectState } from "./components/EditorObject/types"; const sampleContentData = [ { id: "testing1", type: ComponentTypes.HEADLINE, children: "This is a test (HEADLINE)", parent: false, }, { id: "testing2", type: ComponentTypes.TEXT, children: "This is a test (TEXT)", parent: false, }, ]; describe("Editor Actions (Unit)", () => { const id1 = "testing1"; const id2 = "testing2"; it("Should move an item in the content array to another location in the content array", () => { const content = moveThisByThat(sampleContentData, id1, id2); expect(content[1]["id"]).toEqual(id1); }); it("Should change the state when I hover over it", () => { const content = changeState( sampleContentData, id1, EditorObjectState.HOVER ); expect(content[0]["state"] == EditorObjectState.HOVER); }); it("Should change the state when I hover away from it", () => {}); it("Should change the state when I click on it", () => {}); it("Should not clear the state if active when i hover away from it", () => {}); it("Shoudl clear the state of all others when i click on it", () => {}); });