UNPKG

@applicaster/zapp-react-native-utils

Version:

Applicaster Zapp React Native utilities package

14 lines (11 loc) 410 B
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 }); }); });