mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 04:15:48 -06:00
test(cua-computer): verify CUA Driver enum contract
This commit is contained in:
@@ -23,7 +23,7 @@ const sdk = {
|
||||
createTrustedSession: mocks.createTrustedSession,
|
||||
};
|
||||
|
||||
import { createCuaDriver } from "./driver-client.js";
|
||||
import { ClickButton, createCuaDriver, ScrollDirection } from "./driver-client.js";
|
||||
|
||||
const authorization = {
|
||||
allowedModes: ["unrestricted"],
|
||||
@@ -48,6 +48,22 @@ describe("CUA Driver direct session", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("matches the installed CUA Driver desktop input enum contract", async () => {
|
||||
const driverSdk = await import("@trycua/cua-driver");
|
||||
|
||||
expect(ClickButton).toEqual({
|
||||
Left: driverSdk.ClickButton.Left,
|
||||
Right: driverSdk.ClickButton.Right,
|
||||
Middle: driverSdk.ClickButton.Middle,
|
||||
});
|
||||
expect(ScrollDirection).toEqual({
|
||||
Up: driverSdk.ScrollDirection.Up,
|
||||
Down: driverSdk.ScrollDirection.Down,
|
||||
Left: driverSdk.ScrollDirection.Left,
|
||||
Right: driverSdk.ScrollDirection.Right,
|
||||
});
|
||||
});
|
||||
|
||||
it("uses configured creation and one fixed trusted OpenClaw session", async () => {
|
||||
const driver = createCuaDriver({ loadSdk: () => sdk as never });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user