import { makeAppObjectRepo } from "@vived/core";
import { SetLandmarkSizeUcMark } from "../Mocks/SetLandmarkSizeUcMark";
import { updateLandmarkSize } from "./updateLandmarkSize";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const landmarkAo = appObjects.getOrCreate("landmarkId");
    const mockSeLandmarkSizeUC = new SetLandmarkSizeUcMark(landmarkAo);
    const mockSubmitWarning = jest.fn();
    appObjects.submitWarning = mockSubmitWarning;
    return {
        appObjects,
        landmarkAo,
        mockSubmitWarning,
        mockSeLandmarkSizeUC,
    };
}
describe("UpdateLandmarkSize Controller", () => {
    it("Submits warning if App Object doesn't have SetLandmarkSizeUC App Object", () => {
        const { appObjects, mockSubmitWarning } = makeTestRig();
        appObjects.getOrCreate("newlandmarkAo");
        updateLandmarkSize(0.7, "newlandmarkAo", appObjects);
        expect(mockSubmitWarning).toHaveBeenCalledWith("SubmitLandmarkSizeController", "SetLandmarkSizeUC App Object was not added.");
    });
    it("Calls updateSize", () => {
        const { appObjects, mockSeLandmarkSizeUC, landmarkAo } = makeTestRig();
        updateLandmarkSize(0.7, "landmarkId", appObjects);
        expect(mockSeLandmarkSizeUC.updateSize).toHaveBeenCalled();
    });
});
//# sourceMappingURL=updateLandmarkSize.test.js.map