Files
oh-my-pi/packages/coding-agent/test/session-color.test.ts
T
can1357 7467add484 refactor(coding-agent): unified session title and accent handling around session names
- Removed title-source aware branching from session terminal-title and accent helpers, and updated callers to use session name plus cwd only.
- Dropped UUID-based recent-session naming by preferring explicit header titles or first user prompts and generating an "Untitled · <time>" fallback.
- Adjusted welcome session-row rendering for width-aware name truncation and disabled reasoning in title generation requests to keep terminal titles concise.
2026-05-02 01:42:06 +02:00

20 lines
744 B
TypeScript

import { describe, expect, it } from "bun:test";
import { getSessionAccentHex } from "../src/utils/session-color";
import { formatSessionTerminalTitle } from "../src/utils/title-generator";
describe("getSessionAccentHex", () => {
it("returns a stable hex for the same name", () => {
expect(getSessionAccentHex("Named session")).toBe(getSessionAccentHex("Named session"));
});
});
describe("formatSessionTerminalTitle", () => {
it("uses the session name when present", () => {
expect(formatSessionTerminalTitle("Manual title", "/work/pi")).toBe("π: Manual title");
});
it("falls back to the cwd basename when the session name is missing", () => {
expect(formatSessionTerminalTitle(undefined, "/work/pi")).toBe("π: pi");
});
});