@@ -43,6 +43,8 @@ Tests are split by domain. Each file tests one slice of the imperative
4343| [ visioncamera.constraints.harness.ts] ( visioncamera.constraints.harness.ts ) | ` VisionCamera.resolveConstraints ` + ` onSessionConfigSelected ` , FPS / HDR / stabilization / binned / pixelFormat / resolutionBias constraints |
4444| [ visioncamera.controller.harness.ts] ( visioncamera.controller.harness.ts ) | ` CameraController ` — zoom, torch, exposure bias, focus metering, low-light boost, subject area listener |
4545| [ visioncamera.coordinates.harness.ts] ( visioncamera.coordinates.harness.ts ) | ` Frame.convertFramePointToCameraPoint ` / ` convertCameraPointToFramePoint ` , ` PreviewView.convertViewPointToCameraPoint ` / ` convertCameraPointToViewPoint ` , ` PreviewView.createMeteringPoint ` , ` convertScannedObjectCoordinatesToViewCoordinates ` , end-to-end Frame → Camera → View round-trip |
46+ | [ visioncamera.nativepreviewview.harness.tsx] ( visioncamera.nativepreviewview.harness.tsx ) | Bare ` NativePreviewView ` lifecycle, layout-sensitive preview regression coverage, ` resizeMode ` , Android ` implementationMode ` , gesture controllers, multi-preview mounting, ` PreviewView ` ref methods, Android ` takeSnapshot() ` dimensions |
47+ | [ visioncamera.camera-view.harness.tsx] ( visioncamera.camera-view.harness.tsx ) | High-level ` <Camera> ` preview lifecycle, layout-sensitive preview regression coverage, photo output integration, controller props, native gestures, ` CameraRef ` methods, Android ` implementationMode ` / ` takeSnapshot() ` dimensions |
4648
4749Pick the file that best matches what you're testing. If you're reproducing a
4850bug that spans multiple outputs, put it in the file most central to the
@@ -293,18 +295,21 @@ If your PR fails CI, the fastest way to debug is:
293295
294296## High-level components / hooks (` <Camera> ` , ` useCamera() ` , etc.)
295297
296- Tests for the high-level ` <Camera> ` component and the ` useCamera() ` /
297- similar React hooks are ** not yet in scope here** . They'll live alongside
298- the imperative tests when added — same principles, same folder.
298+ High-level component tests live alongside the imperative suites when the API
299+ surface is React rendering, layout, or component convenience behavior. Keep
300+ them focused: render the smallest component tree that reproduces the behavior,
301+ wait on real lifecycle events, and assert through the public ref or callbacks.
299302
300- ** Exception: mounting native Hybrid views to exercise their ref methods is
301- allowed.** Some imperative APIs (e.g. ` PreviewView.convertViewPointToCameraPoint ` ,
303+ For layout regressions, prefer geometry and native ref assertions over golden
304+ screenshots. Device Farm camera feeds are not stable visual fixtures.
305+
306+ Mounting native Hybrid views to exercise their ref methods is still allowed.
307+ Some imperative APIs (e.g. ` PreviewView.convertViewPointToCameraPoint ` ,
302308` PreviewView.createMeteringPoint ` ) can only be reached through a mounted,
303309laid-out view. Those tests may ` render(<NativePreviewView ... />) ` from
304310` react-native-harness ` , capture the ref via ` hybridRef ` , and call the methods
305- directly — see [ visioncamera.coordinates.harness.ts] ( visioncamera.coordinates.harness.ts )
306- for the pattern. Keep the wrapper minimal: no ` <Camera> ` , no ` useCamera() ` ,
307- no ` usePreviewOutput() ` — drive the session imperatively as everywhere else
308- in this folder, and only the view is rendered.
311+ directly — see [ visioncamera.nativepreviewview.harness.tsx] ( visioncamera.nativepreviewview.harness.tsx )
312+ and [ visioncamera.coordinates.harness.ts] ( visioncamera.coordinates.harness.ts )
313+ for the imperative pattern.
309314
310315[ react-native-harness ] : https://github.com/margelo/react-native-harness
0 commit comments