"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const ToolRepository_1 = require("../../Tools/Entities/ToolRepository");
const UCs_1 = require("../UCs");
const setupHideable_1 = require("./setupHideable");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const toolRepo = (0, ToolRepository_1.makeToolRepo)(appObjects.getOrCreate("Tools"));
    return { appObjects, toolRepo };
}
describe("Setup Hideable", () => {
    it("Sets up the serializer and tool if no options are passed in", () => {
        const { appObjects, toolRepo } = makeTestRig();
        const ao = (0, setupHideable_1.setupHideable)(appObjects);
        expect(ao.hasComponent(UCs_1.SerializeHideableObjects.type)).toEqual(true);
        expect(toolRepo.getTool("HIDE")).not.toBeUndefined();
    });
    it("Does not setup the serializer if the option is set to to true", () => {
        const { appObjects, toolRepo } = makeTestRig();
        const ao = (0, setupHideable_1.setupHideable)(appObjects, { skipSerializer: true });
        expect(ao.hasComponent(UCs_1.SerializeHideableObjects.type)).toEqual(false);
    });
    it("Does not setup the tool if the option is set to to true", () => {
        const { appObjects, toolRepo } = makeTestRig();
        const ao = (0, setupHideable_1.setupHideable)(appObjects, { skipSetupTool: true });
        expect(toolRepo.getTool("HIDE")).toBeUndefined();
    });
});
//# sourceMappingURL=setupHideable.test.js.map