Show optimistic chat for new workspaces
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildDraftPanelDescriptor } from "@/panels/draft-panel-descriptor";
|
||||
|
||||
function TestIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
describe("buildDraftPanelDescriptor", () => {
|
||||
it("uses the initial prompt title and running loader bucket during create", () => {
|
||||
const descriptor = buildDraftPanelDescriptor({
|
||||
isCreating: true,
|
||||
pendingPrompt: "Build the dashboard",
|
||||
icon: TestIcon,
|
||||
});
|
||||
|
||||
expect(descriptor).toMatchObject({
|
||||
label: "Build the dashboard",
|
||||
subtitle: "Creating agent",
|
||||
titleState: "ready",
|
||||
statusBucket: "running",
|
||||
});
|
||||
});
|
||||
|
||||
it("falls back to the draft title for empty create prompts", () => {
|
||||
const descriptor = buildDraftPanelDescriptor({
|
||||
isCreating: true,
|
||||
pendingPrompt: " ",
|
||||
icon: TestIcon,
|
||||
});
|
||||
|
||||
expect(descriptor.label).toBe("New Agent");
|
||||
});
|
||||
|
||||
it("keeps ordinary draft tabs labeled as new agents", () => {
|
||||
const descriptor = buildDraftPanelDescriptor({ isCreating: false, icon: TestIcon });
|
||||
|
||||
expect(descriptor).toMatchObject({
|
||||
label: "New Agent",
|
||||
subtitle: "New Agent",
|
||||
titleState: "ready",
|
||||
statusBucket: null,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user