"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const ZSpaceEntity_1 = require("../Entities/ZSpaceEntity");
const ZSpaceIsSupportedPM_1 = require("./ZSpaceIsSupportedPM");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const ao = appObjects.getOrCreate("zSpace");
    const zSpace = (0, ZSpaceEntity_1.makeZSpaceEntity)(ao);
    zSpace.isSupported = true;
    const pm = (0, ZSpaceIsSupportedPM_1.makeZSpaceIsSupportedPM)(ao);
    return { zSpace, pm, appObjects };
}
describe("ZSpace Display Presentation Manager", () => {
    it("Initializes the VM", () => {
        const { pm } = makeTestRig();
        const lastVM = pm.lastVM;
        expect(lastVM).toEqual(true);
    });
    it("Sets the show based on the is rendering flag", () => {
        const { pm, zSpace } = makeTestRig();
        zSpace.isSupported = false;
        zSpace.notifyOnChange();
        expect(pm.lastVM).toEqual(false);
        zSpace.isSupported = true;
        zSpace.notifyOnChange();
        expect(pm.lastVM).toEqual(true);
    });
    it("Checks for equal vms", () => {
        const { pm } = makeTestRig();
        expect(pm.vmsAreEqual(true, true)).toEqual(true);
        expect(pm.vmsAreEqual(false, false)).toEqual(true);
    });
    it("Checks for a change in the VM", () => {
        const { pm } = makeTestRig();
        expect(pm.vmsAreEqual(true, false)).toEqual(false);
        expect(pm.vmsAreEqual(false, true)).toEqual(false);
    });
    it("Gets the PM", () => {
        const { pm, appObjects } = makeTestRig();
        expect(ZSpaceIsSupportedPM_1.ZSpaceIsSupportedPM.get(appObjects)).toEqual(pm);
    });
});
//# sourceMappingURL=ZSpaceIsSupportedPM.test.js.map