"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const screenHoverLabelAdapter_1 = require("./screenHoverLabelAdapter");
const ScreenHoverLabelPmMock_1 = require("../Mocks/ScreenHoverLabelPmMock");
const core_1 = require("@vived/core");
const ScreenHoverLabelPM_1 = require("../PM/ScreenHoverLabelPM");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const mockPM = (0, ScreenHoverLabelPmMock_1.makeScreenHoverLabelPmMock)(appObjects);
    return { appObjects, mockPM };
}
describe("Screen Hover Label Adapter", () => {
    it("Sets the Default VM", () => {
        expect(screenHoverLabelAdapter_1.screenHoverLabelAdapter.defaultVM).toEqual(ScreenHoverLabelPM_1.defaultScreenHoverLabelVM);
    });
    it("Add a view on subscribe", () => {
        const { mockPM, appObjects } = makeTestRig();
        mockPM.addView = jest.fn();
        const setVM = jest.fn();
        screenHoverLabelAdapter_1.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_1.screenHoverLabelAdapter.unsubscribe(appObjects, setVM);
        expect(mockPM.removeView).toHaveBeenCalledWith(setVM);
    });
});
//# sourceMappingURL=screenHoverLabelAdapter.test.js.map