huskies: merge 1058

This commit is contained in:
dave
2026-05-14 18:58:53 +00:00
parent 595777f366
commit 7d7e02f7b0
6 changed files with 133 additions and 18 deletions
+10 -10
View File
@@ -471,13 +471,13 @@ describe("Slash command handling (Story 374)", () => {
});
});
describe("Bug 450: WebSocket error messages displayed in chat", () => {
describe("Story 1058: WebSocket errors do not appear in chat", () => {
beforeEach(() => {
capturedWsHandlers = null;
setupMocks();
});
it("AC1: WebSocket error message is shown in chat as an assistant message", async () => {
it("does not add a chat message when onError is called", async () => {
render(<Chat projectPath="/tmp/project" onCloseProject={vi.fn()} />);
await waitFor(() => expect(capturedWsHandlers).not.toBeNull());
@@ -487,11 +487,11 @@ describe("Bug 450: WebSocket error messages displayed in chat", () => {
});
expect(
await screen.findByText("Something went wrong on the server."),
).toBeInTheDocument();
screen.queryByText("Something went wrong on the server."),
).not.toBeInTheDocument();
});
it("AC2: OAuth login URL in WebSocket error is rendered as a clickable link", async () => {
it("does not add a chat message for errors containing a URL", async () => {
render(<Chat projectPath="/tmp/project" onCloseProject={vi.fn()} />);
await waitFor(() => expect(capturedWsHandlers).not.toBeNull());
@@ -502,10 +502,10 @@ describe("Bug 450: WebSocket error messages displayed in chat", () => {
);
});
const link = await screen.findByRole("link", {
name: /https:\/\/example\.com\/oauth\/login/,
});
expect(link).toBeInTheDocument();
expect(link).toHaveAttribute("href", "https://example.com/oauth/login");
expect(
screen.queryByRole("link", {
name: /https:\/\/example\.com\/oauth\/login/,
}),
).not.toBeInTheDocument();
});
});