import { makeAppObjectRepo, Vector2 } from "@vived/core";
import { makeMockScenePixelPickUC } from "../Mocks";
import { scenePixelPick, ScenePixelPickUC } from "./ScenePixelPickUC";
function makeTestRig() {
    const appObjects = makeAppObjectRepo();
    const ao = appObjects.getOrCreate("AO");
    const mockPickUC = makeMockScenePixelPickUC(appObjects);
    const mockSubmitWarning = jest.fn();
    appObjects.submitWarning = mockSubmitWarning;
    return { appObjects, ao, mockPickUC, mockSubmitWarning };
}
describe("Scene Pixel Pick UC", () => {
    it("Gets the UC", () => {
        const { mockPickUC, appObjects } = makeTestRig();
        expect(ScenePixelPickUC.get(appObjects)).toEqual(mockPickUC);
    });
    it("Finds and uses the SceneRayPickUC", () => {
        const { appObjects, mockPickUC } = makeTestRig();
        scenePixelPick(new Vector2(1, 2), appObjects);
        expect(mockPickUC.scenePixelPick).toHaveBeenCalledWith(new Vector2(1, 2));
    });
    it("Warns if it can't find SceneRayPickUC", () => {
        const { mockPickUC, appObjects, mockSubmitWarning } = makeTestRig();
        mockPickUC.dispose();
        scenePixelPick(new Vector2(1, 2), appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=ScenePixelPickUC.test.js.map