import { makeAppObjectRepo, Vector3 } from "@vived/core";
import { makeCalloutEntity } from "../Entities/CalloutEntity";
import { CalloutOffsetPM, makeCalloutOffsetPM } from "./CalloutOffsetPM";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const appObj = appObjects.getOrCreate("appObj");
    const ao = appObjects.getOrCreate("callout");
    const callout = makeCalloutEntity(ao);
    const pm = makeCalloutOffsetPM(ao);
    return { appObj, appObjects, pm, callout };
}
describe("Callout Line Presentation Manager", () => {
    it("Gets the PM", () => {
        const { appObjects, pm } = makeTestRig();
        expect(CalloutOffsetPM.get("callout", appObjects)).toEqual(pm);
    });
    it("Sets the last vm on construction", () => {
        const { pm } = makeTestRig();
        expect(pm.lastVM).not.toBeUndefined();
    });
    it("Updates the view when the callout entity changes", () => {
        const { pm, callout } = makeTestRig();
        callout.labelPosition = new Vector3(1, 0, 0);
        callout.rootPosition = new Vector3(-1, 0, 0);
        expect(pm.lastVM).toEqual("RIGHT");
        callout.labelPosition = new Vector3(-1, 0, 0);
        callout.rootPosition = new Vector3(1, 0, 0);
        expect(pm.lastVM).toEqual("LEFT");
    });
    it("Checks for equal VMs", () => {
        const { pm } = makeTestRig();
        expect(pm.vmsAreEqual("DOWN", "DOWN")).toEqual(true);
        expect(pm.vmsAreEqual("DOWN", "UP")).toEqual(false);
    });
});
//# sourceMappingURL=CalloutOffsetPM.test.js.map