import { makeAppObjectRepo } from "@vived/core";
import { makeMockSetChallengeUC } from "../Mocks/MockSetChallengeUC";
import { setChallenge } from "./setChallenge";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const mockUC = makeMockSetChallengeUC(appObjects);
    return { appObjects, mockUC };
}
describe("Click Set Inspector", () => {
    it("Calls the UC", () => {
        const { appObjects, mockUC } = makeTestRig();
        setChallenge("Challenge1", appObjects);
        expect(mockUC.setChallenge).toHaveBeenCalledWith("Challenge1");
    });
    it("Warns if there is no UC", () => {
        const { appObjects, mockUC } = makeTestRig();
        mockUC.dispose();
        appObjects.submitWarning = jest.fn();
        setChallenge("Challenge1", appObjects);
        expect(appObjects.submitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=setChallenge.test.js.map