import { makeAppObjectRepo } from "@vived/core";
import { MockUpdateContentSizeUC } from "../Mocks/MockUpdateContentSizeUC";
import { updateContentSize } from "./updateContentSize";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const appAO = appObjects.getOrCreate("App");
    const mockUC = new 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();
        updateContentSize(666, appObjects);
        expect(mockUC.updateContentSize).toHaveBeenCalledWith(666);
    });
    it("Warns if it can't find the UC", () => {
        const { mockUC, appObjects, mockSubmitWarning } = makeTestRig();
        mockUC.dispose();
        updateContentSize(666, appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=updateContentSize.test.js.map