mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 22:28:27 +00:00
test: move duplicate local scenario suites out of agents e2e
This commit is contained in:
27
src/agents/identity.human-delay.test.ts
Normal file
27
src/agents/identity.human-delay.test.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { resolveHumanDelayConfig } from "./identity.js";
|
||||
|
||||
describe("resolveHumanDelayConfig", () => {
|
||||
it("returns undefined when no humanDelay config is set", () => {
|
||||
const cfg: OpenClawConfig = {};
|
||||
expect(resolveHumanDelayConfig(cfg, "main")).toBeUndefined();
|
||||
});
|
||||
|
||||
it("merges defaults with per-agent overrides", () => {
|
||||
const cfg: OpenClawConfig = {
|
||||
agents: {
|
||||
defaults: {
|
||||
humanDelay: { mode: "natural", minMs: 800, maxMs: 1800 },
|
||||
},
|
||||
list: [{ id: "main", humanDelay: { mode: "custom", minMs: 400 } }],
|
||||
},
|
||||
};
|
||||
|
||||
expect(resolveHumanDelayConfig(cfg, "main")).toEqual({
|
||||
mode: "custom",
|
||||
minMs: 400,
|
||||
maxMs: 1800,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user