"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const GlbModelEntity_1 = require("./GlbModelEntity");
const GblModelRepo_1 = require("./GblModelRepo");
const core_1 = require("@vived/core");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const repo = (0, GblModelRepo_1.makeGlbModelRepo)(appObjects.getOrCreate("Repo"));
    const observer = jest.fn();
    repo.addChangeObserver(observer);
    const model = (0, GlbModelEntity_1.makeGlbModelEntity)(appObjects.getOrCreate("model1"));
    repo.add(model);
    observer.mockClear();
    return { observer, repo, model, appObjects };
}
describe("Scene Model Repo", () => {
    it("Creates a channel model with an ID", () => {
        const { repo } = makeTestRig();
        expect(repo.hasForAppObject("newMode")).toEqual(false);
        const model = repo.createGlbModel("newMode");
        expect(repo.hasForAppObject("newMode")).toEqual(true);
        expect(model.id).toEqual("newMode");
    });
    it("Creates a channel model without an ID", () => {
        const { repo } = makeTestRig();
        const model = repo.createGlbModel();
        expect(repo.hasForAppObject(model.id)).toEqual(true);
        expect(model.id).not.toBeUndefined();
    });
});
//# sourceMappingURL=GblModelRepo.test.js.map