"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const slideNavigationAdapter_1 = require("./slideNavigationAdapter");
const SlideNavigationMock_1 = require("../Mocks/SlideNavigationMock");
const SlideNavigationPM_1 = require("../PM/SlideNavigationPM");
const core_1 = require("@vived/core");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const mockPM = (0, SlideNavigationMock_1.makeSlideNavigationMock)(appObjects);
    return { appObjects, mockPM };
}
describe("Slide Text Adapter", () => {
    it("Sets the Default VM", () => {
        expect(slideNavigationAdapter_1.slideNavigationAdapter.defaultVM).toEqual(SlideNavigationPM_1.defaultSlideNavigationVM);
    });
    it("Add a view on subscribe", () => {
        const { mockPM, appObjects } = makeTestRig();
        mockPM.addView = jest.fn();
        const setVM = jest.fn();
        slideNavigationAdapter_1.slideNavigationAdapter.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();
        slideNavigationAdapter_1.slideNavigationAdapter.unsubscribe(appObjects, setVM);
        expect(mockPM.removeView).toHaveBeenCalledWith(setVM);
    });
});
//# sourceMappingURL=slideNavigationAdapter.test.js.map