"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const Transform3D_1 = require("../../Transform3D");
const LandmarkRepo_1 = require("./LandmarkRepo");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const repoAO = appObjects.getOrCreate("repo");
    const repo = (0, LandmarkRepo_1.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 = (0, Transform3D_1.makeTransform3D)(appObjects.getOrCreate("surrogate"));
        repo.applySurrogateTransform(surrogateT);
        expect(repo.transform).toEqual(surrogateT);
    });
});
//# sourceMappingURL=LandmarkRepo.test.js.map