"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const Dispatcher_1 = require("../../Dispatcher");
const Entities_1 = require("../Entities");
const SetInXRUC_1 = require("./SetInXRUC");
class MockDispatcher extends Dispatcher_1.DispatchStartZSpaceUC {
    constructor() {
        super(...arguments);
        this.doDispatch = jest.fn();
    }
}
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const appObj = appObjects.getOrCreate(Entities_1.StoredView.type);
    const dispatcher = appObjects.getOrCreate("Dispatcher");
    const mockDispatcher = new MockDispatcher(dispatcher, Dispatcher_1.DispatchStartZSpaceUC.type);
    const uc = (0, SetInXRUC_1.makeSetViewInXRUC)(appObj);
    return {
        appObj,
        uc,
        mockDispatcher,
        appObjects,
    };
}
describe("Set In XR UC", () => {
    it("Dispatches to start XR", () => {
        const { mockDispatcher, uc } = makeTestRig();
        uc.setViewInXR();
        expect(mockDispatcher.doDispatch).toHaveBeenCalled();
    });
    it("Gets the UC", () => {
        const { appObjects, uc } = makeTestRig();
        expect(SetInXRUC_1.SetViewInXRUC.get(appObjects)).toEqual(uc);
    });
});
//# sourceMappingURL=SetInXRUC.test.js.map