"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const UC_1 = require("../UC");
const core_1 = require("@vived/core");
const clickEditSlideText_1 = require("./clickEditSlideText");
class MockEditSlideText extends UC_1.EditSlideTextUC {
    constructor() {
        super(...arguments);
        this.editSlideText = jest.fn();
        this.submitCallback = jest.fn();
    }
}
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const ao = appObjects.getOrCreate("app");
    const mockEdit = new MockEditSlideText(ao, UC_1.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();
        (0, clickEditSlideText_1.clickEditSlideText)(appObjects);
        expect(mockEdit.editSlideText).toHaveBeenCalled();
    });
    it("Warns if it cannot find the UC", () => {
        const { appObjects, mockSubmitWarning, mockEdit } = makeTestRig();
        mockEdit.dispose();
        mockSubmitWarning.mockClear();
        (0, clickEditSlideText_1.clickEditSlideText)(appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=clickEditSlideText.test.js.map