mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 04:44:59 +00:00
test(gateway): fix HookAction narrowing in prototype protection tests
This commit is contained in:
@@ -390,8 +390,11 @@ describe("hooks mapping", () => {
|
||||
path: "gmail",
|
||||
});
|
||||
expect(result?.ok).toBe(true);
|
||||
if (result?.ok && result.action && result.action.kind === "agent") {
|
||||
expect(result.action.message).toBe("value: ");
|
||||
if (result?.ok) {
|
||||
const action = result.action;
|
||||
if (action?.kind === "agent") {
|
||||
expect(action.message).toBe("value: ");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -411,8 +414,11 @@ describe("hooks mapping", () => {
|
||||
path: "gmail",
|
||||
});
|
||||
expect(result?.ok).toBe(true);
|
||||
if (result?.ok && result.action && result.action.kind === "agent") {
|
||||
expect(result.action.message).toBe("type: ");
|
||||
if (result?.ok) {
|
||||
const action = result.action;
|
||||
if (action?.kind === "agent") {
|
||||
expect(action.message).toBe("type: ");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -432,8 +438,11 @@ describe("hooks mapping", () => {
|
||||
path: "gmail",
|
||||
});
|
||||
expect(result?.ok).toBe(true);
|
||||
if (result?.ok && result.action && result.action.kind === "agent") {
|
||||
expect(result.action.message).toBe("val: ");
|
||||
if (result?.ok) {
|
||||
const action = result.action;
|
||||
if (action?.kind === "agent") {
|
||||
expect(action.message).toBe("val: ");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user