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