"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const SetLandmarkSizeUcMark_1 = require("../Mocks/SetLandmarkSizeUcMark");
const submitLandmarkSize_1 = require("./submitLandmarkSize");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const landmarkAo = appObjects.getOrCreate("landmarkId");
    const mockSeLandmarkSizeUC = new SetLandmarkSizeUcMark_1.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");
        (0, submitLandmarkSize_1.submitLandmarkSize)(0.7, "newlandmarkAo", appObjects);
        expect(mockSubmitWarning).toHaveBeenCalledWith("SubmitLandmarkSizeController", "SetLandmarkSizeUC App Object was not added.");
    });
    it("Calls updateSize", () => {
        const { appObjects, mockSeLandmarkSizeUC, landmarkAo } = makeTestRig();
        (0, submitLandmarkSize_1.submitLandmarkSize)(0.7, landmarkAo.id, appObjects);
        expect(mockSeLandmarkSizeUC.submitSize).toHaveBeenCalled();
    });
});
//# sourceMappingURL=submitLandmarkSize.test.js.map