"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const SceneRootEntity_1 = require("../../SceneRoot/Entities/SceneRootEntity");
const CalloutEntity_1 = require("../Entities/CalloutEntity");
const CalloutScaleHook_1 = require("./CalloutScaleHook");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const sceneRoot = (0, SceneRootEntity_1.makeSceneRootEntity)(appObjects.getOrCreate("SceneRoot"));
    const ao = appObjects.getOrCreate("callout");
    const callout = (0, CalloutEntity_1.makeCalloutEntity)(ao);
    new CalloutScaleHook_1.CalloutScaleHook(ao);
    return { callout, sceneRoot };
}
describe("Callout scale hook", () => {
    it("Scales the transform when the scene root scale changes", () => {
        const { callout, sceneRoot } = makeTestRig();
        callout.labelTransform.localScale = core_1.Vector3.One();
        callout.size = 0.5;
        sceneRoot.scale = 4;
        expect(callout.labelTransform.localScale).toEqual(new core_1.Vector3(0.125, 0.125, 0.125));
    });
    it("Scales the transform when the size changes", () => {
        const { callout, sceneRoot } = makeTestRig();
        callout.labelTransform.localScale = core_1.Vector3.One();
        callout.size = 0.5;
        sceneRoot.scale = 4;
        expect(callout.labelTransform.localScale).toEqual(new core_1.Vector3(0.125, 0.125, 0.125));
        callout.size = 1;
        expect(callout.labelTransform.localScale).toEqual(new core_1.Vector3(0.25, 0.25, 0.25));
    });
});
//# sourceMappingURL=CalloutScaleHook.test.js.map