"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@vived/core");
const Mocks_1 = require("../Mocks");
const ScenePixelPickUC_1 = require("./ScenePixelPickUC");
function makeTestRig() {
    const appObjects = (0, core_1.makeAppObjectRepo)();
    const ao = appObjects.getOrCreate("AO");
    const mockPickUC = (0, Mocks_1.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_1.ScenePixelPickUC.get(appObjects)).toEqual(mockPickUC);
    });
    it("Finds and uses the SceneRayPickUC", () => {
        const { appObjects, mockPickUC } = makeTestRig();
        (0, ScenePixelPickUC_1.scenePixelPick)(new core_1.Vector2(1, 2), appObjects);
        expect(mockPickUC.scenePixelPick).toHaveBeenCalledWith(new core_1.Vector2(1, 2));
    });
    it("Warns if it can't find SceneRayPickUC", () => {
        const { mockPickUC, appObjects, mockSubmitWarning } = makeTestRig();
        mockPickUC.dispose();
        (0, ScenePixelPickUC_1.scenePixelPick)(new core_1.Vector2(1, 2), appObjects);
        expect(mockSubmitWarning).toHaveBeenCalled();
    });
});
//# sourceMappingURL=ScenePixelPickUC.test.js.map