import { makeAppObjectRepo } from "@vived/core";
import { makeTransform3D } from "../../Transform3D";
import { makeLandmarkRepoEntity } from "./LandmarkRepo";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const repoAO = appObjects.getOrCreate("repo");
    const repo = makeLandmarkRepoEntity(repoAO);
    return { repo, appObjects };
}
describe("Landmark Repo", () => {
    it("Making a landmark adds it to the repo by default", () => {
        const { repo } = makeTestRig();
        const landmark = repo.createLandmark();
        expect(repo.hasForAppObject(landmark.appObject.id)).toEqual(true);
    });
    it("Deleting a landmark", () => {
        const { repo } = makeTestRig();
        const landmark = repo.createLandmark();
        expect(repo.hasForAppObject(landmark.appObject.id)).toEqual(true);
        repo.deleteLandmark(landmark.appObject.id);
        expect(repo.hasForAppObject(landmark.appObject.id)).toEqual(false);
    });
    it("Replace the Transform with a surrogate", () => {
        const { repo, appObjects } = makeTestRig();
        const surrogateT = makeTransform3D(appObjects.getOrCreate("surrogate"));
        repo.applySurrogateTransform(surrogateT);
        expect(repo.transform).toEqual(surrogateT);
    });
});
//# sourceMappingURL=LandmarkRepo.test.js.map