fix(webui): show actual local trigger messages (#5228)

This commit is contained in:
chengyongru
2026-08-03 16:43:01 +08:00
committed by GitHub
parent eeecfac538
commit f11710a578
6 changed files with 90 additions and 3 deletions
@@ -113,6 +113,43 @@ describe("SessionInfoPopover", () => {
expect(screen.queryByText(/ago/i)).not.toBeInTheDocument();
});
it("shows the actual message received by a local trigger", async () => {
vi.stubGlobal(
"fetch",
vi.fn().mockResolvedValue(
automationsResponse([
{
id: "trg_123",
name: "PR monitor",
enabled: true,
kind: "local_trigger",
schedule: { kind: "local" },
payload: {
kind: "local_trigger",
message: "Review PR #4591",
command: 'nanobot trigger trg_123 "message"',
},
state: { pending: false },
},
]),
),
);
const user = userEvent.setup();
render(
<SessionInfoPopover
sessionKey="websocket:chat-1"
token="tok"
title="Release work"
/>,
);
await user.click(screen.getByRole("button", { name: "Session details" }));
expect(await screen.findByText("Review PR #4591")).toBeInTheDocument();
expect(screen.queryByText('nanobot trigger trg_123 "message"')).not.toBeInTheDocument();
});
it("refreshes while open so completed one-shot automations disappear", async () => {
vi.stubGlobal(
"fetch",