import { makeAppObjectRepo } from "@vived/core";
import { UndoRedoEntity } from "../Entities/UndoRedoEntity";
import { doRedo } from "./doRedo";
class MockMockUndoRedo extends UndoRedoEntity {
    constructor() {
        super(...arguments);
        this.submitAction = jest.fn();
        this.doUndo = jest.fn();
        this.doRedo = jest.fn();
        this.clearStack = jest.fn();
    }
    get hasUndo() {
        throw new Error("Method not implemented.");
    }
    get hasRedo() {
        throw new Error("Method not implemented.");
    }
}
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const app = appObjects.getOrCreate("App");
    const mockUndo = new MockMockUndoRedo(app, UndoRedoEntity.type);
    return { mockUndo, appObjects };
}
describe("Do Redo Controller", () => {
    it("Triggers the UC", () => {
        const { appObjects, mockUndo } = makeTestRig();
        doRedo(appObjects);
        expect(mockUndo.doRedo).toHaveBeenCalled();
    });
    it("Warns if it can't find the UC", () => {
        const { appObjects, mockUndo } = makeTestRig();
        appObjects.submitWarning = jest.fn();
        mockUndo.dispose();
        doRedo(appObjects);
        expect(appObjects.submitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=doRedo.test.js.map