test: tighten discord model picker data assertion

This commit is contained in:
Shakker
2026-05-10 20:23:00 +01:00
parent a68f8fa540
commit 8cbea2e69c

View File

@@ -810,21 +810,22 @@ describe("Discord model picker interactions", () => {
.spyOn(modelPickerModule, "loadDiscordModelPickerData")
.mockResolvedValue(pickerData);
const interaction = createInteraction({ userId: "owner" });
const cfg = {
...context.cfg,
agents: {
defaults: {
model: { primary: "anthropic/claude-opus-4-5" },
models: {
"openai-codex/*": {},
"vllm/*": {},
},
},
},
} as OpenClawConfig;
await replyWithDiscordModelPickerProviders({
interaction: interaction as never,
cfg: {
...context.cfg,
agents: {
defaults: {
model: { primary: "anthropic/claude-opus-4-5" },
models: {
"openai-codex/*": {},
"vllm/*": {},
},
},
},
} as OpenClawConfig,
cfg,
command: "model",
userId: "owner",
accountId: context.accountId,
@@ -833,7 +834,7 @@ describe("Discord model picker interactions", () => {
safeInteractionCall: async (_label, fn) => await fn(),
});
expect(loadSpy).toHaveBeenCalledWith(expect.any(Object), "main");
expect(loadSpy).toHaveBeenCalledWith(cfg, "main");
const payload = JSON.stringify(interaction.reply.mock.calls[0]?.[0]);
expect(payload).toContain("openai-codex");
expect(payload).toContain("gpt-5.5-codex");