import { makeAppObjectRepo } from "@vived/core";
import { makeMockToolRepo } from "../Mocks";
import { triggerTool } from "./triggerTool";
export function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const ao = appObjects.getOrCreate("App");
    const mockRepo = makeMockToolRepo(appObjects);
    return { mockRepo, appObjects };
}
describe("Trigger Tool Controller", () => {
    it("Triggers the tool", () => {
        const { mockRepo, appObjects } = makeTestRig();
        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();
        triggerTool("Tool1", appObjects);
        expect(appObjects.submitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=triggerTool.test.js.map