import { makeAppObjectRepo } from "@vived/core";
import { SetLandmarkSizeUcMark } from "../Mocks/SetLandmarkSizeUcMark";
import { submitLandmarkSize } from "./submitLandmarkSize";
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("SubmitLandmarkSize Controller", () => {
    it("Submits warning if App Object doesn't have SetLandmarkSizeUC App Object", () => {
        const { appObjects, mockSubmitWarning } = makeTestRig();
        appObjects.getOrCreate("newlandmarkAo");
        submitLandmarkSize(0.7, "newlandmarkAo", appObjects);
        expect(mockSubmitWarning).toHaveBeenCalledWith("SubmitLandmarkSizeController", "SetLandmarkSizeUC App Object was not added.");
    });
    it("Calls updateSize", () => {
        const { appObjects, mockSeLandmarkSizeUC, landmarkAo } = makeTestRig();
        submitLandmarkSize(0.7, landmarkAo.id, appObjects);
        expect(mockSeLandmarkSizeUC.submitSize).toHaveBeenCalled();
    });
});
//# sourceMappingURL=submitLandmarkSize.test.js.map