"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const zSpaceViewerScaleAdapter_1 = require("./zSpaceViewerScaleAdapter");
const ZSpaceViewerScalePmMock_1 = require("../Mocks/ZSpaceViewerScalePmMock");
const core_1 = require("@vived/core");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const mockPM = (0, ZSpaceViewerScalePmMock_1.makeZSpaceViewerScalePmMock)(appObjects);
    return { appObjects, mockPM };
}
describe("zSpace Viewer Scale Adapter", () => {
    it("Sets the Default VM", () => {
        expect(zSpaceViewerScaleAdapter_1.zSpaceViewerScaleAdapter.defaultVM).toEqual(1);
    });
    it("Add a view on subscribe", () => {
        const { mockPM, appObjects } = makeTestRig();
        mockPM.addView = jest.fn();
        const setVM = jest.fn();
        zSpaceViewerScaleAdapter_1.zSpaceViewerScaleAdapter.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();
        zSpaceViewerScaleAdapter_1.zSpaceViewerScaleAdapter.unsubscribe(appObjects, setVM);
        expect(mockPM.removeView).toHaveBeenCalledWith(setVM);
    });
});
//# sourceMappingURL=zSpaceViewerScaleAdapter.test.js.map