Files
writing-agent/tests/feed-prefs.test.ts
chenmoranzhiandCursor 66ed1eaca8 会话与前端接上听书、呈现投影、请求轮廓和旁观气泡偏好。
新建作品可选听书连载,朗读与消费进度走专用接口。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-07 23:49:44 +08:00

54 lines
1.3 KiB
TypeScript

import { describe, expect, it, beforeEach, afterEach } from "vitest";
import {
applyPlayAuxLlmBubbles,
isPlayAuxLlmBubblesEnabled,
isPlayAuxLlmOutput,
} from "../web/feed-prefs.js";
describe("play aux LLM bubbles", () => {
beforeEach(() => {
applyPlayAuxLlmBubbles(false);
});
afterEach(() => {
applyPlayAuxLlmBubbles(false);
});
it("stores the more-menu preference", () => {
expect(isPlayAuxLlmBubblesEnabled()).toBe(false);
applyPlayAuxLlmBubbles(true);
expect(isPlayAuxLlmBubblesEnabled()).toBe(true);
});
it("treats auditor worker_output as aux and world-simulator as main", () => {
const play = { lifecycleStage: "play" };
expect(
isPlayAuxLlmOutput(
{ role: "assistant", kind: "worker_output", actor: "auditor" },
play,
),
).toBe(true);
expect(
isPlayAuxLlmOutput(
{
role: "assistant",
kind: "worker_output",
actor: "world-simulator",
title: "主世界层 · 产出",
},
play,
),
).toBe(false);
expect(
isPlayAuxLlmOutput(
{
role: "assistant",
kind: "worker_output",
actor: "narrator",
title: "叙事转述 · 产出",
},
play,
),
).toBe(false);
});
});