"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const MockUpdateContentSizeUC_1 = require("../Mocks/MockUpdateContentSizeUC");
const updateContentSize_1 = require("./updateContentSize");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const appAO = appObjects.getOrCreate("App");
    const mockUC = new MockUpdateContentSizeUC_1.MockUpdateContentSizeUC(appAO);
    const mockSubmitWarning = jest.fn();
    appObjects.submitWarning = mockSubmitWarning;
    return {
        mockUC,
        mockSubmitWarning,
        appObjects,
    };
}
describe("Submit Render Canvas", () => {
    it("Submits the canvas to mockUC", () => {
        const { mockUC, appObjects } = makeTestRig();
        (0, updateContentSize_1.updateContentSize)(666, appObjects);
        expect(mockUC.updateContentSize).toHaveBeenCalledWith(666);
    });
    it("Warns if it can't find the UC", () => {
        const { mockUC, appObjects, mockSubmitWarning } = makeTestRig();
        mockUC.dispose();
        (0, updateContentSize_1.updateContentSize)(666, appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=updateContentSize.test.js.map