test: anchor slash command refreshes · openclaw/openclaw@d267880
shakkernerd
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -334,7 +334,12 @@ describe("parseSlashCommand", () => {
|
334 | 334 | includeArgs: true, |
335 | 335 | scope: "text", |
336 | 336 | }); |
337 | | -expect(SLASH_COMMANDS.map((entry) => entry.name)).toContain("pair"); |
| 337 | +expectRecordFields(requireCommandByName("pair"), "pair command", { |
| 338 | +name: "pair", |
| 339 | +description: "Generate setup codes.", |
| 340 | +executeLocal: false, |
| 341 | +tier: "standard", |
| 342 | +}); |
338 | 343 | }); |
339 | 344 | |
340 | 345 | it("falls back safely when the gateway returns malformed command payload shapes", async () => { |
@@ -372,7 +377,11 @@ describe("parseSlashCommand", () => {
|
372 | 377 | agentId: "main", |
373 | 378 | }); |
374 | 379 | expect(SLASH_COMMANDS.find((entry) => entry.name === "pair")).toBeUndefined(); |
375 | | -expect(SLASH_COMMANDS.map((entry) => entry.name)).toContain("help"); |
| 380 | +expectRecordFields(requireCommandByName("help"), "help command", { |
| 381 | +key: "help", |
| 382 | +name: "help", |
| 383 | +executeLocal: true, |
| 384 | +}); |
376 | 385 | |
377 | 386 | await refreshSlashCommands({ |
378 | 387 | client: { request } as never, |
@@ -432,7 +441,12 @@ describe("parseSlashCommand", () => {
|
432 | 441 | } |
433 | 442 | await pending; |
434 | 443 | |
435 | | -expect(SLASH_COMMANDS.map((entry) => entry.name)).toContain("pair"); |
| 444 | +expectRecordFields(requireCommandByName("pair"), "pair command", { |
| 445 | +name: "pair", |
| 446 | +description: "Generate setup codes.", |
| 447 | +executeLocal: false, |
| 448 | +tier: "standard", |
| 449 | +}); |
436 | 450 | expect(SLASH_COMMANDS.find((entry) => entry.name === "dreaming")).toBeUndefined(); |
437 | 451 | }); |
438 | 452 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。