mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:28:26 +00:00
test(commands): replace subagent gateway reset with lightweight clear
This commit is contained in:
@@ -276,7 +276,7 @@ describe("/approve command", () => {
|
|||||||
} as OpenClawConfig;
|
} as OpenClawConfig;
|
||||||
const params = buildParams("/approve abc allow-once", cfg, { SenderId: "123" });
|
const params = buildParams("/approve abc allow-once", cfg, { SenderId: "123" });
|
||||||
|
|
||||||
callGatewayMock.mockResolvedValueOnce({ ok: true });
|
callGatewayMock.mockResolvedValue({ ok: true });
|
||||||
|
|
||||||
const result = await handleCommands(params);
|
const result = await handleCommands(params);
|
||||||
expect(result.shouldContinue).toBe(false);
|
expect(result.shouldContinue).toBe(false);
|
||||||
@@ -299,7 +299,7 @@ describe("/approve command", () => {
|
|||||||
GatewayClientScopes: ["operator.write"],
|
GatewayClientScopes: ["operator.write"],
|
||||||
});
|
});
|
||||||
|
|
||||||
callGatewayMock.mockResolvedValueOnce({ ok: true });
|
callGatewayMock.mockResolvedValue({ ok: true });
|
||||||
|
|
||||||
const result = await handleCommands(params);
|
const result = await handleCommands(params);
|
||||||
expect(result.shouldContinue).toBe(false);
|
expect(result.shouldContinue).toBe(false);
|
||||||
@@ -313,7 +313,7 @@ describe("/approve command", () => {
|
|||||||
} as OpenClawConfig;
|
} as OpenClawConfig;
|
||||||
const scopeCases = [["operator.approvals"], ["operator.admin"]];
|
const scopeCases = [["operator.approvals"], ["operator.admin"]];
|
||||||
for (const scopes of scopeCases) {
|
for (const scopes of scopeCases) {
|
||||||
callGatewayMock.mockResolvedValueOnce({ ok: true });
|
callGatewayMock.mockResolvedValue({ ok: true });
|
||||||
const params = buildParams("/approve abc allow-once", cfg, {
|
const params = buildParams("/approve abc allow-once", cfg, {
|
||||||
Provider: "webchat",
|
Provider: "webchat",
|
||||||
Surface: "webchat",
|
Surface: "webchat",
|
||||||
@@ -907,7 +907,7 @@ describe("handleCommands context", () => {
|
|||||||
describe("handleCommands subagents", () => {
|
describe("handleCommands subagents", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
resetSubagentRegistryForTests();
|
resetSubagentRegistryForTests();
|
||||||
callGatewayMock.mockReset();
|
callGatewayMock.mockClear().mockImplementation(async () => ({}));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("lists subagents when none exist", async () => {
|
it("lists subagents when none exist", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user