Files
famapp/tests/unit/assistant-preference.test.ts
T
ginnoir e5e509081c
CI / checks (push) Failing after 2m12s
CI / build (push) Successful in 4m50s
feat: per-user assistant name and system prompt customization
Each user can rename the AI assistant and edit their own system prompt in Settings.
2026-07-04 23:26:17 -05:00

28 lines
901 B
TypeScript

import assert from "node:assert/strict";
import { describe, it } from "node:test";
import {
DEFAULT_ASSISTANT_NAME,
resolveAssistantSystemPrompt,
} from "../../src/lib/assistant-config";
import { AGENT_SYSTEM_PROMPT } from "../../src/modules/agent/tools";
describe("resolveAssistantSystemPrompt", () => {
it("returns the default prompt when custom is null", () => {
assert.equal(resolveAssistantSystemPrompt(null), AGENT_SYSTEM_PROMPT);
});
it("returns the default prompt when custom is blank", () => {
assert.equal(resolveAssistantSystemPrompt(" "), AGENT_SYSTEM_PROMPT);
});
it("returns trimmed custom prompt when set", () => {
assert.equal(resolveAssistantSystemPrompt(" Be extra cheerful. "), "Be extra cheerful.");
});
});
describe("DEFAULT_ASSISTANT_NAME", () => {
it("is Assistant", () => {
assert.equal(DEFAULT_ASSISTANT_NAME, "Assistant");
});
});