import { makeAppObjectRepo } from "@vived/core";
import { DispatchStartZSpaceUC } from "../../Dispatcher";
import { StoredView } from "../Entities";
import { makeSetViewInXRUC, SetViewInXRUC } from "./SetInXRUC";
class MockDispatcher extends DispatchStartZSpaceUC {
    constructor() {
        super(...arguments);
        this.doDispatch = jest.fn();
    }
}
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const appObj = appObjects.getOrCreate(StoredView.type);
    const dispatcher = appObjects.getOrCreate("Dispatcher");
    const mockDispatcher = new MockDispatcher(dispatcher, DispatchStartZSpaceUC.type);
    const uc = 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(SetViewInXRUC.get(appObjects)).toEqual(uc);
    });
});
//# sourceMappingURL=SetInXRUC.test.js.map