Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,21 @@ const notificationEntry: MessageEntry = {
},
};

// A standalone direction:"response" entry (e.g. the client's answer to a
// server→client request such as roots/list or sampling) — no request-style
// status badge should appear; "Pending" in particular would be misleading.
const standaloneResponseEntry: MessageEntry = {
id: "resp-1",
timestamp: new Date("2026-03-17T10:37:00Z"),
direction: "response",
origin: "client",
message: {
jsonrpc: "2.0",
id: 10,
result: { roots: [] },
},
};

const baseProps = {
isPinned: false,
isListExpanded: false,
Expand Down Expand Up @@ -153,6 +168,17 @@ describe("HistoryEntry", () => {
expect(screen.queryByText("Error")).not.toBeInTheDocument();
});

it("renders no request-style status badge for a standalone response entry", () => {
renderWithMantine(
<HistoryEntry {...baseProps} entry={standaloneResponseEntry} />,
);
// A standalone direction:"response" (e.g. client answering roots/list or
// sampling) carries no request lifecycle — no Pending/OK/Error badge.
expect(screen.queryByText("Pending")).not.toBeInTheDocument();
expect(screen.queryByText("OK")).not.toBeInTheDocument();
expect(screen.queryByText("Error")).not.toBeInTheDocument();
});

it("shows client → server for a client-originated entry", () => {
renderWithMantine(<HistoryEntry {...baseProps} entry={successEntry} />);
expect(screen.getByText("client → server")).toBeInTheDocument();
Expand Down