"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const AddCorrectObjectIdUcMock_1 = require("../Mocks/AddCorrectObjectIdUcMock");
const addCorrectObjectPickID_1 = require("./addCorrectObjectPickID");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const mockUC = (0, AddCorrectObjectIdUcMock_1.makeAddCorrectObjectIdUcMock)(appObjects);
    return { appObjects, mockUC };
}
describe("Add correct object pick ID", () => {
    it("Calls the UC", () => {
        const { appObjects, mockUC } = makeTestRig();
        (0, addCorrectObjectPickID_1.addCorrectObjectPickID)("obj1", appObjects);
        expect(mockUC.addCorrectObjectId).toHaveBeenCalledWith("obj1");
    });
    it("Warns if there is no UC", () => {
        const { appObjects, mockUC } = makeTestRig();
        mockUC.dispose();
        appObjects.submitWarning = jest.fn();
        (0, addCorrectObjectPickID_1.addCorrectObjectPickID)("obj1", appObjects);
        expect(appObjects.submitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=addCorrectObjectPickID.test.js.map