import { makeAppObjectRepo } from "@vived/core";
import { StateIsCompleteUC } from "../../Dispatcher";
import { clickContinue } from "./clickContinue";
class MockStateIsComplete extends StateIsCompleteUC {
    constructor() {
        super(...arguments);
        this.doDispatch = jest.fn();
    }
}
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const ao = appObjects.getOrCreate("app");
    const mockUC = new MockStateIsComplete(ao, 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();
        clickContinue(appObjects);
        expect(mockUC.doDispatch).toHaveBeenCalled();
    });
    it("Warns if it cannot find the UC", () => {
        const { appObjects, mockSubmitWarning, mockUC } = makeTestRig();
        mockUC.dispose();
        mockSubmitWarning.mockClear();
        clickContinue(appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=clickContinue.test.js.map