import { makeAppObjectRepo } from "@vived/core";
import { ClearCustomLabelUC } from "../UC/ClearCustomLabelUC";
import { clearCustomLabel } from "./ClearCustomLabel";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const mockSubmitWarning = jest.fn();
    appObjects.submitWarning = mockSubmitWarning;
    const ao = appObjects.getOrCreate("App Object ID");
    const clearCustomLabelUC = new ClearCustomLabelUC(ao);
    const mockClearCustomLabel = jest.fn();
    clearCustomLabelUC.clearCustomLabel = mockClearCustomLabel;
    return {
        appObjects,
        ao,
        mockSubmitWarning,
        mockClearCustomLabel,
    };
}
describe("Clear Custom Label Controller", () => {
    it("Calls Clear Custom Label method", () => {
        const { appObjects, ao, mockClearCustomLabel } = makeTestRig();
        clearCustomLabel(ao.id, appObjects);
        expect(mockClearCustomLabel).toHaveBeenCalled();
    });
    it("Submits warning if App Object is not found", () => {
        const { appObjects, mockSubmitWarning } = makeTestRig();
        clearCustomLabel("Test AO", appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
    it("Submits warning if ClearCustomLabel UC was added", () => {
        const { appObjects, mockSubmitWarning } = makeTestRig();
        const ao = appObjects.getOrCreate("TEST AO");
        clearCustomLabel(ao.id, appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=ClearCustomLabel.test.js.map