test(ci): align main test expectations

This commit is contained in:
Vincent Koc
2026-04-28 00:27:02 -07:00
parent 1dd011984a
commit 0b82a7e718
2 changed files with 30 additions and 3 deletions

View File

@@ -113,7 +113,33 @@ describe("buildStatusReply", () => {
expect(reply?.text).not.toContain("Fallbacks: anthropic/claude-sonnet-4-6");
});
it("keeps default fallback config when the agent has no explicit fallback override", async () => {
it("keeps default fallback config when the agent has no explicit model", async () => {
const cfg = {
session: { mainKey: "main", scope: "per-sender" },
agents: {
defaults: {
model: {
primary: "openai/gpt-5.4",
fallbacks: ["anthropic/claude-sonnet-4-6"],
},
},
list: [
{
id: "kira",
},
],
},
channels: {
whatsapp: { allowFrom: ["*"] },
},
} as OpenClawConfig;
const reply = await buildKiraStatusReply(cfg);
expect(reply?.text).toContain("Fallbacks: anthropic/claude-sonnet-4-6");
});
it("keeps agent primary strict when the agent has no explicit fallback override", async () => {
const cfg = {
session: { mainKey: "main", scope: "per-sender" },
agents: {
@@ -139,7 +165,7 @@ describe("buildStatusReply", () => {
const reply = await buildKiraStatusReply(cfg);
expect(reply?.text).toContain("Fallbacks: anthropic/claude-sonnet-4-6");
expect(reply?.text).not.toContain("Fallbacks:");
});
it("treats an explicit empty per-agent fallback override as disabling inherited fallbacks", async () => {

View File

@@ -1,5 +1,6 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
import { stripAnsi } from "../terminal/ansi.js";
import { baseConfigSnapshot, createTestRuntime } from "./test-runtime-config-helpers.js";
const mocks = vi.hoisted(() => ({
@@ -176,7 +177,7 @@ describe("channels list auth profiles", () => {
expect.any(Object),
expect.objectContaining({ includeSetupRuntimeFallback: true }),
);
const output = runtime.log.mock.calls[0]?.[0] as string;
const output = stripAnsi(runtime.log.mock.calls[0]?.[0] as string);
expect(output).toContain("Chat channels:");
expect(output).toContain("Telegram default:");
expect(output).toContain("configured");