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