import { makeAppObjectRepo } from "@vived/core";
import { OverlayColorEnums } from "../Entities";
import { SetOverlayColorUC } from "../UC/SetOverlayColorUC";
import { setOverlayColor } from "./SetOverlayColor";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const mockSubmitWarning = jest.fn();
    appObjects.submitWarning = mockSubmitWarning;
    const ao = appObjects.getOrCreate("App Object ID");
    const setOverlayColorUC = new SetOverlayColorUC(ao);
    const mockSetOverlayColor = jest.fn();
    setOverlayColorUC.setOverlayColor = mockSetOverlayColor;
    return {
        appObjects,
        ao,
        mockSubmitWarning,
        mockSetOverlayColor,
    };
}
describe("Set Overlay Color Controller", () => {
    it("Calls Set Overlay Color method", () => {
        const { appObjects, ao, mockSetOverlayColor } = makeTestRig();
        setOverlayColor(OverlayColorEnums.WHITE, ao.id, appObjects);
        expect(mockSetOverlayColor).toHaveBeenCalledWith(OverlayColorEnums.WHITE);
    });
    it("Submits warning if App Object is not found", () => {
        const { appObjects, mockSubmitWarning } = makeTestRig();
        setOverlayColor(OverlayColorEnums.WHITE, "TEST AO", appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
    it("Submits warning if ClearCustomLabel UC was added", () => {
        const { appObjects, mockSubmitWarning } = makeTestRig();
        const ao = appObjects.getOrCreate("TEST AO");
        setOverlayColor(OverlayColorEnums.WHITE, ao.id, appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=SetOverlayColor.test.js.map