"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const MockSetChallengeUC_1 = require("../Mocks/MockSetChallengeUC");
const setChallenge_1 = require("./setChallenge");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const mockUC = (0, MockSetChallengeUC_1.makeMockSetChallengeUC)(appObjects);
    return { appObjects, mockUC };
}
describe("Click Set Inspector", () => {
    it("Calls the UC", () => {
        const { appObjects, mockUC } = makeTestRig();
        (0, setChallenge_1.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();
        (0, setChallenge_1.setChallenge)("Challenge1", appObjects);
        expect(appObjects.submitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=setChallenge.test.js.map