mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 13:54:57 +00:00
chore: Fix types in tests 28/N.
This commit is contained in:
@@ -255,8 +255,12 @@ describe("commands registry args", () => {
|
||||
});
|
||||
|
||||
it("resolves function-based choices with a default provider/model context", () => {
|
||||
let seen: { provider: string; model: string; commandKey: string; argName: string } | null =
|
||||
null;
|
||||
let seen: {
|
||||
provider?: string;
|
||||
model?: string;
|
||||
commandKey: string;
|
||||
argName: string;
|
||||
} | null = null;
|
||||
|
||||
const command: ChatCommandDefinition = {
|
||||
key: "think",
|
||||
@@ -284,10 +288,16 @@ describe("commands registry args", () => {
|
||||
{ label: "low", value: "low" },
|
||||
{ label: "high", value: "high" },
|
||||
]);
|
||||
expect(seen?.commandKey).toBe("think");
|
||||
expect(seen?.argName).toBe("level");
|
||||
expect(seen?.provider).toBeTruthy();
|
||||
expect(seen?.model).toBeTruthy();
|
||||
const seenChoice = seen as {
|
||||
provider?: string;
|
||||
model?: string;
|
||||
commandKey: string;
|
||||
argName: string;
|
||||
} | null;
|
||||
expect(seenChoice?.commandKey).toBe("think");
|
||||
expect(seenChoice?.argName).toBe("level");
|
||||
expect(seenChoice?.provider).toBeTruthy();
|
||||
expect(seenChoice?.model).toBeTruthy();
|
||||
});
|
||||
|
||||
it("does not show menus when args were provided as raw text only", () => {
|
||||
|
||||
Reference in New Issue
Block a user