test: tighten discord model picker data assertion · openclaw/openclaw@8cbea2e
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
extensions/discord/src/monitor
| Original file line number | Diff line number | Diff line change |
|---|
@@ -810,21 +810,22 @@ describe("Discord model picker interactions", () => {
|
810 | 810 | .spyOn(modelPickerModule, "loadDiscordModelPickerData") |
811 | 811 | .mockResolvedValue(pickerData); |
812 | 812 | const interaction = createInteraction({ userId: "owner" }); |
| 813 | +const cfg = { |
| 814 | + ...context.cfg, |
| 815 | +agents: { |
| 816 | +defaults: { |
| 817 | +model: { primary: "anthropic/claude-opus-4-5" }, |
| 818 | +models: { |
| 819 | +"openai-codex/*": {}, |
| 820 | +"vllm/*": {}, |
| 821 | +}, |
| 822 | +}, |
| 823 | +}, |
| 824 | +} as OpenClawConfig; |
813 | 825 | |
814 | 826 | await replyWithDiscordModelPickerProviders({ |
815 | 827 | interaction: interaction as never, |
816 | | -cfg: { |
817 | | - ...context.cfg, |
818 | | -agents: { |
819 | | -defaults: { |
820 | | -model: { primary: "anthropic/claude-opus-4-5" }, |
821 | | -models: { |
822 | | -"openai-codex/*": {}, |
823 | | -"vllm/*": {}, |
824 | | -}, |
825 | | -}, |
826 | | -}, |
827 | | -} as OpenClawConfig, |
| 828 | + cfg, |
828 | 829 | command: "model", |
829 | 830 | userId: "owner", |
830 | 831 | accountId: context.accountId, |
@@ -833,7 +834,7 @@ describe("Discord model picker interactions", () => {
|
833 | 834 | safeInteractionCall: async (_label, fn) => await fn(), |
834 | 835 | }); |
835 | 836 | |
836 | | -expect(loadSpy).toHaveBeenCalledWith(expect.any(Object), "main"); |
| 837 | +expect(loadSpy).toHaveBeenCalledWith(cfg, "main"); |
837 | 838 | const payload = JSON.stringify(interaction.reply.mock.calls[0]?.[0]); |
838 | 839 | expect(payload).toContain("openai-codex"); |
839 | 840 | expect(payload).toContain("gpt-5.5-codex"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。