mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 12:44:59 +00:00
test: harden Telegram command menu sanitization coverage (#19703)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 6a41b11590
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
This commit is contained in:
@@ -50,6 +50,16 @@ describe("bot-native-command-menu", () => {
|
||||
expect(result.issues).toContain('Plugin command "/empty" is missing a description.');
|
||||
});
|
||||
|
||||
it("normalizes hyphenated plugin command names", () => {
|
||||
const result = buildPluginTelegramMenuCommands({
|
||||
specs: [{ name: "agent-run", description: "Run agent" }],
|
||||
existingCommands: new Set<string>(),
|
||||
});
|
||||
|
||||
expect(result.commands).toEqual([{ command: "agent_run", description: "Run agent" }]);
|
||||
expect(result.issues).toEqual([]);
|
||||
});
|
||||
|
||||
it("deletes stale commands before setting new menu", async () => {
|
||||
const callOrder: string[] = [];
|
||||
const deleteMyCommands = vi.fn(async () => {
|
||||
|
||||
Reference in New Issue
Block a user