"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const zSpaceDisplayAdapter_1 = require("./zSpaceDisplayAdapter");
const ZSpaceDisplayPmMock_1 = require("../Mocks/ZSpaceDisplayPmMock");
const core_1 = require("@vived/core");
const ZSpaceDisplayPM_1 = require("../PM/ZSpaceDisplayPM");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const mockPM = (0, ZSpaceDisplayPmMock_1.makeZSpaceDisplayPmMock)(appObjects);
    return { appObjects, mockPM };
}
describe("zSpace Display Adapter", () => {
    it("Sets the Default VM", () => {
        expect(zSpaceDisplayAdapter_1.zSpaceDisplayAdapter.defaultVM).toEqual(ZSpaceDisplayPM_1.defaultZSpaceDisplayVM);
    });
    it("Add a view on subscribe", () => {
        const { mockPM, appObjects } = makeTestRig();
        mockPM.addView = jest.fn();
        const setVM = jest.fn();
        zSpaceDisplayAdapter_1.zSpaceDisplayAdapter.subscribe(appObjects, setVM);
        expect(mockPM.addView).toHaveBeenCalledWith(setVM);
    });
    it("Removes a view on unsubscribe", () => {
        const { mockPM, appObjects } = makeTestRig();
        mockPM.removeView = jest.fn();
        const setVM = jest.fn();
        zSpaceDisplayAdapter_1.zSpaceDisplayAdapter.unsubscribe(appObjects, setVM);
        expect(mockPM.removeView).toHaveBeenCalledWith(setVM);
    });
});
//# sourceMappingURL=zSpaceDisplayAdapter.test.js.map