import { makeAppObjectRepo, Vector3 } from "@vived/core";
import { makeSceneRootEntity } from "../../SceneRoot/Entities/SceneRootEntity";
import { makeCalloutEntity } from "../Entities/CalloutEntity";
import { CalloutScaleHook } from "./CalloutScaleHook";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const sceneRoot = makeSceneRootEntity(appObjects.getOrCreate("SceneRoot"));
    const ao = appObjects.getOrCreate("callout");
    const callout = makeCalloutEntity(ao);
    new 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 = Vector3.One();
        callout.size = 0.5;
        sceneRoot.scale = 4;
        expect(callout.labelTransform.localScale).toEqual(new Vector3(0.125, 0.125, 0.125));
    });
    it("Scales the transform when the size changes", () => {
        const { callout, sceneRoot } = makeTestRig();
        callout.labelTransform.localScale = Vector3.One();
        callout.size = 0.5;
        sceneRoot.scale = 4;
        expect(callout.labelTransform.localScale).toEqual(new Vector3(0.125, 0.125, 0.125));
        callout.size = 1;
        expect(callout.labelTransform.localScale).toEqual(new Vector3(0.25, 0.25, 0.25));
    });
});
//# sourceMappingURL=CalloutScaleHook.test.js.map