import { makeAppObjectRepo } from "@vived/core";
import { MockRenderUC } from "../Mocks/MockRenderCanvasUC";
import { removeRenderCanvas } from "./removeRenderCanvas";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const appAO = appObjects.getOrCreate("App");
    const mockRenderUC = new MockRenderUC(appAO);
    const mockSubmitWarning = jest.fn();
    appObjects.submitWarning = mockSubmitWarning;
    return {
        mockRenderUC,
        mockSubmitWarning,
        appObjects,
    };
}
describe("Remove Render Canvas", () => {
    it("Clears it from mockRenderUC", () => {
        const { mockRenderUC, appObjects } = makeTestRig();
        removeRenderCanvas(appObjects);
        expect(mockRenderUC.clearCanvas).toHaveBeenCalled();
    });
    it("Warns if it can't find the UC", () => {
        const { mockRenderUC, appObjects, mockSubmitWarning } = makeTestRig();
        mockRenderUC.dispose();
        removeRenderCanvas(appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=removeRenderCanvas.test.js.map