源码快照 @ 2026-09-02 (source-only, 剔除非源码素材)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
|
||||
import { resolveOrganizationPromptCardContent } from "../src/components/chat/task-suggestions";
|
||||
|
||||
describe("organization task suggestions", () => {
|
||||
test("uses the saved description as the card title and selects the full prompt", () => {
|
||||
const prompt = "Analyze the latest churn feedback and summarize the top three risks.";
|
||||
|
||||
expect(resolveOrganizationPromptCardContent({
|
||||
prompt,
|
||||
description: "Review churn feedback",
|
||||
index: 0,
|
||||
})).toEqual({
|
||||
title: "Review churn feedback",
|
||||
description: prompt,
|
||||
selectionPrompt: prompt,
|
||||
});
|
||||
});
|
||||
|
||||
test("keeps a prompt-only fallback title for older policy data", () => {
|
||||
expect(resolveOrganizationPromptCardContent({
|
||||
prompt: "Draft a customer update.",
|
||||
index: 1,
|
||||
}).title).toBe("Organization prompt 2");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user