"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const CalloutEntity_1 = require("../Entities/CalloutEntity");
const CalloutOffsetPM_1 = require("./CalloutOffsetPM");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const appObj = appObjects.getOrCreate("appObj");
    const ao = appObjects.getOrCreate("callout");
    const callout = (0, CalloutEntity_1.makeCalloutEntity)(ao);
    const pm = (0, CalloutOffsetPM_1.makeCalloutOffsetPM)(ao);
    return { appObj, appObjects, pm, callout };
}
describe("Callout Line Presentation Manager", () => {
    it("Gets the PM", () => {
        const { appObjects, pm } = makeTestRig();
        expect(CalloutOffsetPM_1.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 core_1.Vector3(1, 0, 0);
        callout.rootPosition = new core_1.Vector3(-1, 0, 0);
        expect(pm.lastVM).toEqual("RIGHT");
        callout.labelPosition = new core_1.Vector3(-1, 0, 0);
        callout.rootPosition = new core_1.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