feat: testing scaled screenshots to normalized coordinate space
This commit is contained in:
+7
-1
@@ -1,7 +1,7 @@
|
||||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { complete } from "../src/model.js";
|
||||
import { desktopArguments, shellArguments, toolsForCoordinates } from "../src/tools.js";
|
||||
import { desktopArguments, scaleImage, shellArguments, toolsForCoordinates } from "../src/tools.js";
|
||||
|
||||
const config: import("../src/config.js").Config = { coordinateSpace: "pixels", llamaCppOrigin: "http://example.test", modelId: "test", databasePath: ":memory:" };
|
||||
|
||||
@@ -37,3 +37,9 @@ test("tool inputs reject invalid commands, bounds, and action names", () => {
|
||||
assert.throws(() => desktopArguments.parse({ actions: [{ type: "click_target", target: "1" }] }));
|
||||
assert.equal(desktopArguments.parse({ actions: [{ type: "click_target", target: "1", observationId: "frame" }] }).actions[0]?.type, "click_target");
|
||||
});
|
||||
|
||||
test("scaleImage resizes PNG to requested dimensions", async () => {
|
||||
const buffer = await scaleImage("artifacts/first.png", 1000, 1000);
|
||||
assert.ok(Buffer.isBuffer(buffer));
|
||||
assert.ok(buffer.length > 0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user