"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const MockRenderCanvasUC_1 = require("../Mocks/MockRenderCanvasUC");
const removeRenderCanvas_1 = require("./removeRenderCanvas");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const appAO = appObjects.getOrCreate("App");
    const mockRenderUC = new MockRenderCanvasUC_1.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();
        (0, removeRenderCanvas_1.removeRenderCanvas)(appObjects);
        expect(mockRenderUC.clearCanvas).toHaveBeenCalled();
    });
    it("Warns if it can't find the UC", () => {
        const { mockRenderUC, appObjects, mockSubmitWarning } = makeTestRig();
        mockRenderUC.dispose();
        (0, removeRenderCanvas_1.removeRenderCanvas)(appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=removeRenderCanvas.test.js.map