Skip to content

test: lock find click JSON response to exact deterministic key set #182

Closed

Description

@thymikee

Summary

Add a unit test that enforces the exact JSON response shape for find "<query>" click --json to prevent accidental schema drift.

Why

Machine consumers depend on a stable, deterministic schema. We recently aligned find click to return deterministic metadata (ref, locator, query, x, y) and to avoid leaking platform-native response blobs.

Proposed changes

  • Add/extend tests in src/daemon/handlers/__tests__/find.test.ts to assert that response.data for successful find ... click contains exactly these keys:
    • ref
    • locator
    • query
    • x
    • y
  • Assert no extra keys are present (strict key-set assertion).
  • Cover both:
    • normal resolved target with rect
    • fallback coordinate path when resolved hittable ancestor lacks rect

Acceptance criteria

  • pnpm test:unit passes.
  • find click tests fail if any key is added/removed/renamed in the success payload.
  • No platform-specific fields leak into find click success payload.

Activity

  1. added a commit that references this issue on Mar 3, 2026
    737c5a6
  2. added a commit that references this issue on Mar 3, 2026
    e248c87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions