Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions test/lib/init/formatters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,43 @@ describe("formatResult with featureBlurbs", () => {
expect(summary?.fields.some((f) => f.label === "Features")).toBe(true);
});

test("regression: all blurbs render when server returns canonical feature IDs", () => {
// Regression for the 'only Tracing' bug: the LLM was echoing human-readable
// labels ("Error Monitoring") in the feature field instead of canonical IDs
// ("errorMonitoring"). The server-side fix now maps blurbs positionally so
// canonical IDs are always in the feature field. This test verifies the CLI
// renders all blurbs when the server returns canonical IDs correctly — not
// just the one feature that happened to have a matching ID.
const { ui, calls } = createMockUI();
formatResult(
{
status: "success",
result: {
platform: "Next.js",
features: [
"errorMonitoring",
"performanceMonitoring",
"sessionReplay",
],
featureBlurbs: [
{ feature: "errorMonitoring", blurb: "Captures exceptions." },
{ feature: "performanceMonitoring", blurb: "Traces requests." },
{ feature: "sessionReplay", blurb: "Records sessions." },
],
},
},
ui
);

const summary = summaryCall(calls);
expect(summary?.featureBlurbs).toHaveLength(3);
expect(summary?.featureBlurbs?.map((b) => b.label)).toEqual([
"Error Monitoring",
"Session Replay",
"Tracing",
]);
});

test("labels use canonical feature IDs — agent echoing wrong IDs omits the blurb rather than mislabelling", () => {
const { ui, calls } = createMockUI();
formatResult(
Expand Down
Loading