fix: test fix to normalized coordinate space.

This commit is contained in:
Zoe
2026-09-20 23:58:02 -05:00
parent 5ea5c9aeb1
commit d4b5ea0254
4 changed files with 35 additions and 26 deletions
+7 -7
View File
@@ -19,13 +19,13 @@ test("adapter accepts tool calls and rejects truncated responses", async (t) =>
await assert.rejects(complete(config, [], []), /incomplete/);
});
test("tool descriptions do not inject coordinate normalization or pixel prompting", () => {
for (const space of ["pixels", "normalized_1000"] as const) {
const description = toolsForCoordinates(space)[0]?.function.description ?? "";
assert.doesNotMatch(description, /normalized/i);
assert.doesNotMatch(description, /pixel/i);
assert.doesNotMatch(description, /0\.\.1000/);
}
test("tool descriptions advertise coordinate conventions", () => {
const normalized = toolsForCoordinates("normalized_1000")[0]?.function.description ?? "";
assert.match(normalized, /Coordinates must be normalized integers in the range \[0, 1000\], where \(0, 0\) is top-left and \(1000, 1000\) is bottom-right\./);
const pixels = toolsForCoordinates("pixels")[0]?.function.description ?? "";
assert.match(pixels, /Click coordinates are screenshot pixels, not normalized coordinates\./);
assert.doesNotMatch(pixels, /normalized integers in the range/);
});
test("tool inputs reject invalid commands, bounds, and action names", () => {