"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cameraAdapter_1 = require("./cameraAdapter");
const CameraPmMock_1 = require("../Mocks/CameraPmMock");
const core_1 = require("@vived/core");
const CameraPM_1 = require("../PM/CameraPM");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const mockPM = (0, CameraPmMock_1.makeCameraPmMock)(appObjects);
    return { appObjects, mockPM };
}
describe("Camera Adapter", () => {
    it("Sets the Default VM", () => {
        expect(cameraAdapter_1.cameraAdapter.defaultVM).toEqual(CameraPM_1.defaultCameraVM);
    });
    it("Add a view on subscribe", () => {
        const { mockPM, appObjects } = makeTestRig();
        mockPM.addView = jest.fn();
        const setVM = jest.fn();
        cameraAdapter_1.cameraAdapter.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();
        cameraAdapter_1.cameraAdapter.unsubscribe(appObjects, setVM);
        expect(mockPM.removeView).toHaveBeenCalledWith(setVM);
    });
});
//# sourceMappingURL=cameraAdapter.test.js.map