import { findTrackedView } from "../findTrackedView"; describe("findTrackedView", () => { it("should return the view with the closest center to the center of the screen", () => { const array = [ { centerX: 0.2, centerY: 0.3 }, { centerX: 0.4, centerY: 0.5 }, { centerX: 0.6, centerY: 0.7 }, ]; expect(findTrackedView(array)).toEqual({ centerX: 0.4, centerY: 0.5 }); }); });