"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const EnablementEntity_1 = require("../Entities/EnablementEntity");
const EnabledStatePM_1 = require("./EnabledStatePM");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const appObj = appObjects.getOrCreate("appObj1");
    const entity = (0, EnablementEntity_1.makeEnablementEntity)(appObj);
    entity.enabled = true;
    const pm = (0, EnabledStatePM_1.makeEnabledStatePM)(appObj);
    return { pm, appObj, appObjects, entity };
}
describe("Enabled Presentation Manager", () => {
    it("Checks for equal VMs", () => {
        const { pm } = makeTestRig();
        expect(pm.vmsAreEqual(true, true)).toEqual(true);
        expect(pm.vmsAreEqual(false, false)).toEqual(true);
        expect(pm.vmsAreEqual(true, false)).toEqual(false);
        expect(pm.vmsAreEqual(false, true)).toEqual(false);
    });
    it("Sets the VM as expected", () => {
        const { pm, entity } = makeTestRig();
        entity.enabled = true;
        expect(pm.lastVM).toEqual(true);
        entity.enabled = false;
        expect(pm.lastVM).toEqual(false);
    });
    it("Gets the PM", () => {
        const { pm, appObj, appObjects } = makeTestRig();
        expect(EnabledStatePM_1.EnabledStatePM.get(appObj.id, appObjects)).toEqual(pm);
    });
});
//# sourceMappingURL=EnabledStatePM.test.js.map