mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 20:00:42 +00:00
test: tighten gateway id assertions
This commit is contained in:
@@ -101,7 +101,7 @@ describe("abortChatRunById", () => {
|
||||
content: [{ type: "text", text: " Partial reply " }],
|
||||
}),
|
||||
);
|
||||
expect((payload.message as { timestamp?: unknown }).timestamp).toEqual(expect.any(Number));
|
||||
expect((payload.message as { timestamp?: unknown }).timestamp).toBeGreaterThan(0);
|
||||
expect(ops.nodeSendToSession).toHaveBeenCalledWith(sessionKey, "chat", payload);
|
||||
});
|
||||
|
||||
|
||||
@@ -141,7 +141,8 @@ describe("plugin node capability helpers", () => {
|
||||
});
|
||||
expect(refreshed?.surface).toBe("canvas");
|
||||
expect(refreshed?.expiresAtMs).toBe(1_100);
|
||||
expect(refreshed?.capability).toEqual(expect.any(String));
|
||||
expect(refreshed?.capability).toBeTypeOf("string");
|
||||
expect(refreshed?.capability).not.toBe("");
|
||||
expect(refreshed?.scopedUrl).toContain("/__openclaw__/cap/");
|
||||
expect(refreshed?.scopedUrl).not.toContain("old-token/__openclaw__/cap/");
|
||||
expect(client.pluginSurfaceUrls?.canvas).toBe(refreshed?.scopedUrl);
|
||||
|
||||
@@ -443,7 +443,7 @@ describe("gateway silent scope-upgrade reconnect", () => {
|
||||
|
||||
expect(res.ok).toBe(false);
|
||||
expect(res.error?.message).toBe("pairing required: device is not approved yet");
|
||||
expect(replacementRequestId).toEqual(expect.any(String));
|
||||
expect(replacementRequestId).toBeTypeOf("string");
|
||||
expect(replacementRequestId.length).toBeGreaterThan(0);
|
||||
expect(
|
||||
(res.error?.details as { requestId?: unknown; code?: string } | undefined)?.requestId,
|
||||
|
||||
@@ -18,7 +18,7 @@ describe("gateway tools.catalog", () => {
|
||||
}>(ws, "tools.catalog", {});
|
||||
|
||||
expect(res.ok).toBe(true);
|
||||
expect(res.payload?.agentId).toEqual(expect.any(String));
|
||||
expect(res.payload?.agentId).toBeTypeOf("string");
|
||||
expect(res.payload?.agentId).not.toBe("");
|
||||
const mediaGroup = res.payload?.groups?.find((group) => group.id === "media");
|
||||
expect(mediaGroup?.tools?.map((tool) => `${tool.source}:${tool.id}`) ?? []).toContain(
|
||||
|
||||
Reference in New Issue
Block a user