Files
Jyotisha/frontend/tests/chat-definition-lists.test.ts
T
Jesse_Chen 995b752e70 fix(web): keep consultation thinking above one spoken answer
Per-domain thinking trees were interleaved with sliced analysis, so a finished reply still looked like unfinished checklists. One collapsed thinking panel and one full body restores the reading order.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-23 01:49:05 +08:00

32 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import assert from "node:assert/strict";
import test from "node:test";
import { promoteDefinitionLists } from "../src/lib/chat-definition-lists.ts";
test("consecutive label-colon paragraphs become a markdown list", () => {
const promoted = promoteDefinitionLists([
"行运焦点:",
"",
"月亮行运三分本命太阳(orb 0.29°):情绪与精力契合。",
"",
"天王星行运三分本命月亮(orb 0.75°):突发灵感可能冒出来。",
"",
"海王星行运对本命月亮(orb 0.87°):注意信息模糊。",
].join("\n"));
assert.match(promoted, /^- \*\*月亮行运三分本命太阳(orb 0\.29°)\*\*:情绪与精力契合。$/m);
assert.match(promoted, /^- \*\*天王星行运三分本命月亮(orb 0\.75°)\*\*:突发灵感可能冒出来。$/m);
assert.match(promoted, /行运焦点:/);
assert.equal(promoted.includes("- **行运焦点**"), false);
});
test("code fences and existing lists are left alone", () => {
const source = [
"```",
"标签:不要动",
"```",
"",
"- 已有列表:保持原样",
].join("\n");
assert.equal(promoteDefinitionLists(source), source);
});