mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:40:44 +00:00
test(ci): align main test expectations
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user