"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const DeleteAllCalloutsUC_1 = require("../UC/DeleteAllCalloutsUC");
const deleteAllCallouts_1 = require("./deleteAllCallouts");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const deleteAllCalloutsUC = (0, DeleteAllCalloutsUC_1.makeDeleteAllCalloutsUC)(appObjects.getOrCreate("App"));
    const mockDeleteAllCallouts = jest.fn();
    deleteAllCalloutsUC.deleteAllCallouts = mockDeleteAllCallouts;
    return {
        appObjects,
        mockDeleteAllCallouts,
    };
}
describe("Delete All Callouts Controller", () => {
    it("Calls deleteAllCallouts", () => {
        const { appObjects, mockDeleteAllCallouts } = makeTestRig();
        (0, deleteAllCallouts_1.deleteAllCallouts)(appObjects);
        expect(mockDeleteAllCallouts).toHaveBeenCalled();
    });
    it("Submits warning if not found DeleteAllCalloutsUC", () => {
        const appObjects = (0, core_1.makeAppObjectRepo)();
        const mockSubmitWarning = jest.fn();
        appObjects.submitWarning = mockSubmitWarning;
        (0, deleteAllCallouts_1.deleteAllCallouts)(appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=deleteAllCallouts.test.js.map