import { zSpaceDisplayAdapter } from "./zSpaceDisplayAdapter";
import { makeZSpaceDisplayPmMock } from "../Mocks/ZSpaceDisplayPmMock";
import { makeAppObjectRepo } from "@vived/core";
import { defaultZSpaceDisplayVM } from "../PM/ZSpaceDisplayPM";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const mockPM = makeZSpaceDisplayPmMock(appObjects);
    return { appObjects, mockPM };
}
describe("zSpace Display Adapter", () => {
    it("Sets the Default VM", () => {
        expect(zSpaceDisplayAdapter.defaultVM).toEqual(defaultZSpaceDisplayVM);
    });
    it("Add a view on subscribe", () => {
        const { mockPM, appObjects } = makeTestRig();
        mockPM.addView = jest.fn();
        const setVM = jest.fn();
        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.unsubscribe(appObjects, setVM);
        expect(mockPM.removeView).toHaveBeenCalledWith(setVM);
    });
});
//# sourceMappingURL=zSpaceDisplayAdapter.test.js.map