import { EditSlideTextUC } from "../UC";
import { makeAppObjectRepo } from "@vived/core";
import { clickEditSlideText } from "./clickEditSlideText";
class MockEditSlideText extends EditSlideTextUC {
    constructor() {
        super(...arguments);
        this.editSlideText = jest.fn();
        this.submitCallback = jest.fn();
    }
}
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const ao = appObjects.getOrCreate("app");
    const mockEdit = new MockEditSlideText(ao, EditSlideTextUC.type);
    const mockSubmitWarning = jest.fn();
    appObjects.submitWarning = mockSubmitWarning;
    return { mockSubmitWarning, appObjects, mockEdit };
}
describe("Click edit slide text", () => {
    it("Triggers the UC", () => {
        const { appObjects, mockEdit } = makeTestRig();
        clickEditSlideText(appObjects);
        expect(mockEdit.editSlideText).toHaveBeenCalled();
    });
    it("Warns if it cannot find the UC", () => {
        const { appObjects, mockSubmitWarning, mockEdit } = makeTestRig();
        mockEdit.dispose();
        mockSubmitWarning.mockClear();
        clickEditSlideText(appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=clickEditSlideText.test.js.map