import { makeAppObjectRepo } from "@vived/core";
import { makeZSpaceEntity, ZSpaceDevice } from "../Entities";
import { CheckZSpaceDisplaySizeImp, } from "./CheckZSpaceDisplaySizeUC";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const zSpaceAO = appObjects.getOrCreate("zSpace");
    const zSpaceEntity = makeZSpaceEntity(zSpaceAO);
    const displayEntity = zSpaceEntity.display;
    displayEntity.setForDevice(ZSpaceDevice.INSPIRE);
    const checkDisplayUC = new CheckZSpaceDisplaySizeImp(zSpaceAO);
    return {
        checkDisplayUC,
        zSpaceEntity,
    };
}
describe("Check zSpace Display Size UC", () => {
    it("Sets the zSpace viewer scale if the width is different than Inspire width", () => {
        const { checkDisplayUC, zSpaceEntity } = makeTestRig();
        const size = {
            width: 0.52,
            height: 0.29,
        };
        zSpaceEntity.display.setForSize = jest.fn();
        checkDisplayUC.checkDisplayFromSize(size);
        expect(zSpaceEntity.viewerScale).toBeCloseTo(0.66);
        expect(zSpaceEntity.display.setForSize).toHaveBeenCalledWith(0.52, 0.29);
    });
    it("Does not set the zSpace viewer scale if the width is the same as Inspire width", () => {
        const { checkDisplayUC, zSpaceEntity } = makeTestRig();
        const size = {
            width: 0.344,
            height: 0.19,
        };
        zSpaceEntity.display.setForSize = jest.fn();
        checkDisplayUC.checkDisplayFromSize(size);
        expect(zSpaceEntity.viewerScale).toBeCloseTo(1);
        expect(zSpaceEntity.display.setForSize).not.toHaveBeenCalled();
    });
});
//# sourceMappingURL=CheckZSpaceDisplaySizeUC.test.js.map