"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const Dispatcher_1 = require("../../Dispatcher");
const clickContinue_1 = require("./clickContinue");
class MockStateIsComplete extends Dispatcher_1.StateIsCompleteUC {
    constructor() {
        super(...arguments);
        this.doDispatch = jest.fn();
    }
}
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const ao = appObjects.getOrCreate("app");
    const mockUC = new MockStateIsComplete(ao, Dispatcher_1.StateIsCompleteUC.type);
    const mockSubmitWarning = jest.fn();
    appObjects.submitWarning = mockSubmitWarning;
    return { mockSubmitWarning, appObjects, mockUC };
}
describe("Click edit slide text", () => {
    it("Triggers the UC", () => {
        const { appObjects, mockUC } = makeTestRig();
        (0, clickContinue_1.clickContinue)(appObjects);
        expect(mockUC.doDispatch).toHaveBeenCalled();
    });
    it("Warns if it cannot find the UC", () => {
        const { appObjects, mockSubmitWarning, mockUC } = makeTestRig();
        mockUC.dispose();
        mockSubmitWarning.mockClear();
        (0, clickContinue_1.clickContinue)(appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=clickContinue.test.js.map