import { makeAppObjectRepo } from "@vived/core";
import { makeEnablementEntity } from "../Entities/EnablementEntity";
import { EnabledStatePM, makeEnabledStatePM } from "./EnabledStatePM";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const appObj = appObjects.getOrCreate("appObj1");
    const entity = makeEnablementEntity(appObj);
    entity.enabled = true;
    const pm = 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.get(appObj.id, appObjects)).toEqual(pm);
    });
});
//# sourceMappingURL=EnabledStatePM.test.js.map