import { makeGlbModelEntity } from "./GlbModelEntity";
import { makeGlbModelRepo } from "./GblModelRepo";
import { makeAppObjectRepo } from "@vived/core";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const repo = makeGlbModelRepo(appObjects.getOrCreate("Repo"));
    const observer = jest.fn();
    repo.addChangeObserver(observer);
    const model = 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