"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeTestRig = makeTestRig;
const core_1 = require("@vived/core");
const Mocks_1 = require("../Mocks");
const triggerTool_1 = require("./triggerTool");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const ao = appObjects.getOrCreate("App");
    const mockRepo = (0, Mocks_1.makeMockToolRepo)(appObjects);
    return { mockRepo, appObjects };
}
describe("Trigger Tool Controller", () => {
    it("Triggers the tool", () => {
        const { mockRepo, appObjects } = makeTestRig();
        (0, triggerTool_1.triggerTool)("Tool1", appObjects);
        expect(mockRepo.triggerTool).toHaveBeenCalledWith("Tool1");
    });
    it("Warns if it cannot find the repo", () => {
        const { mockRepo, appObjects } = makeTestRig();
        appObjects.submitWarning = jest.fn();
        mockRepo.dispose();
        (0, triggerTool_1.triggerTool)("Tool1", appObjects);
        expect(appObjects.submitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=triggerTool.test.js.map