"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const worldHoverLabelAdapter_1 = require("./worldHoverLabelAdapter");
const WorldHoverLabelPmMock_1 = require("../Mocks/WorldHoverLabelPmMock");
const core_1 = require("@vived/core");
const WorldHoverLabelPM_1 = require("../PM/WorldHoverLabelPM");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const mockPM = (0, WorldHoverLabelPmMock_1.makeWorldHoverLabelPmMock)(appObjects);
    return { appObjects, mockPM };
}
describe("World Hover Label Adapter", () => {
    it("Sets the Default VM", () => {
        expect(worldHoverLabelAdapter_1.worldHoverLabelAdapter.defaultVM).toEqual(WorldHoverLabelPM_1.defaultWorldHoverLabelVM);
    });
    it("Add a view on subscribe", () => {
        const { mockPM, appObjects } = makeTestRig();
        mockPM.addView = jest.fn();
        const setVM = jest.fn();
        worldHoverLabelAdapter_1.worldHoverLabelAdapter.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();
        worldHoverLabelAdapter_1.worldHoverLabelAdapter.unsubscribe(appObjects, setVM);
        expect(mockPM.removeView).toHaveBeenCalledWith(setVM);
    });
});
//# sourceMappingURL=worldHoverLabelAdapter.test.js.map