import { makeAppObjectRepo } from "@vived/core";
import { makeInspectorTabPmMock } from "../Mocks/InspectorTabPmMock";
import { defaultInspectorTabVM } from "../PMs/InspectorTabPM";
import { inspectorTabAdapter } from "./inspectorTabAdapter";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const mockPM = makeInspectorTabPmMock(appObjects);
    return { appObjects, mockPM };
}
describe("Is Authoring Adapter", () => {
    it("Sets the Default VM", () => {
        expect(inspectorTabAdapter.defaultVM).toEqual(defaultInspectorTabVM);
    });
    it("Add a view on subscribe", () => {
        const { mockPM, appObjects } = makeTestRig();
        mockPM.addView = jest.fn();
        const setVM = jest.fn();
        inspectorTabAdapter.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();
        inspectorTabAdapter.unsubscribe(appObjects, setVM);
        expect(mockPM.removeView).toHaveBeenCalledWith(setVM);
    });
});
//# sourceMappingURL=inspectorTabAdapter.test.js.map