mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 23:21:36 +00:00
test: remove duplicate inbound-meta coverage from reply-flow
This commit is contained in:
@@ -2,10 +2,9 @@ import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
|
|||||||
import { expectInboundContextContract } from "../../../test/helpers/inbound-contract.js";
|
import { expectInboundContextContract } from "../../../test/helpers/inbound-contract.js";
|
||||||
import type { OpenClawConfig } from "../../config/config.js";
|
import type { OpenClawConfig } from "../../config/config.js";
|
||||||
import { defaultRuntime } from "../../runtime.js";
|
import { defaultRuntime } from "../../runtime.js";
|
||||||
import type { MsgContext, TemplateContext } from "../templating.js";
|
import type { MsgContext } from "../templating.js";
|
||||||
import { HEARTBEAT_TOKEN, SILENT_REPLY_TOKEN } from "../tokens.js";
|
import { HEARTBEAT_TOKEN, SILENT_REPLY_TOKEN } from "../tokens.js";
|
||||||
import { finalizeInboundContext } from "./inbound-context.js";
|
import { finalizeInboundContext } from "./inbound-context.js";
|
||||||
import { buildInboundUserContextPrefix } from "./inbound-meta.js";
|
|
||||||
import { normalizeInboundTextNewlines } from "./inbound-text.js";
|
import { normalizeInboundTextNewlines } from "./inbound-text.js";
|
||||||
import { parseLineDirectives, hasLineDirectives } from "./line-directives.js";
|
import { parseLineDirectives, hasLineDirectives } from "./line-directives.js";
|
||||||
import type { FollowupRun, QueueSettings } from "./queue.js";
|
import type { FollowupRun, QueueSettings } from "./queue.js";
|
||||||
@@ -13,27 +12,6 @@ import { enqueueFollowupRun, scheduleFollowupDrain } from "./queue.js";
|
|||||||
import { createReplyDispatcher } from "./reply-dispatcher.js";
|
import { createReplyDispatcher } from "./reply-dispatcher.js";
|
||||||
import { createReplyToModeFilter, resolveReplyToMode } from "./reply-threading.js";
|
import { createReplyToModeFilter, resolveReplyToMode } from "./reply-threading.js";
|
||||||
|
|
||||||
describe("buildInboundUserContextPrefix", () => {
|
|
||||||
it("omits conversation label block for direct chats", () => {
|
|
||||||
const text = buildInboundUserContextPrefix({
|
|
||||||
ChatType: "direct",
|
|
||||||
ConversationLabel: "openclaw-tui",
|
|
||||||
} as TemplateContext);
|
|
||||||
|
|
||||||
expect(text).toBe("");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("keeps conversation label for group chats", () => {
|
|
||||||
const text = buildInboundUserContextPrefix({
|
|
||||||
ChatType: "group",
|
|
||||||
ConversationLabel: "ops-room",
|
|
||||||
} as TemplateContext);
|
|
||||||
|
|
||||||
expect(text).toContain("Conversation info (untrusted metadata):");
|
|
||||||
expect(text).toContain('"conversation_label": "ops-room"');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("normalizeInboundTextNewlines", () => {
|
describe("normalizeInboundTextNewlines", () => {
|
||||||
it("converts CRLF to LF", () => {
|
it("converts CRLF to LF", () => {
|
||||||
expect(normalizeInboundTextNewlines("hello\r\nworld")).toBe("hello\nworld");
|
expect(normalizeInboundTextNewlines("hello\r\nworld")).toBe("hello\nworld");
|
||||||
|
|||||||
Reference in New Issue
Block a user