mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-09 08:11:09 +00:00
test(ui): cover abortable stop state without stream
This commit is contained in:
@@ -689,6 +689,27 @@ describe("chat view", () => {
|
||||
expect(container.textContent).not.toContain("New session");
|
||||
});
|
||||
|
||||
it("shows a stop button when aborting is available without an active stream", () => {
|
||||
const container = document.createElement("div");
|
||||
render(
|
||||
renderChat(
|
||||
createProps({
|
||||
canAbort: true,
|
||||
sending: false,
|
||||
stream: null,
|
||||
onAbort: vi.fn(),
|
||||
}),
|
||||
),
|
||||
container,
|
||||
);
|
||||
|
||||
const stopButton = container.querySelector<HTMLButtonElement>('button[title="Stop"]');
|
||||
const sendButton = container.querySelector<HTMLButtonElement>('button[title="Send"]');
|
||||
expect(stopButton).not.toBeNull();
|
||||
expect(sendButton).toBeNull();
|
||||
expect(container.textContent).not.toContain("New session");
|
||||
});
|
||||
|
||||
it("shows a new session button when aborting is unavailable", () => {
|
||||
const container = document.createElement("div");
|
||||
const onNewSession = vi.fn();
|
||||
|
||||
Reference in New Issue
Block a user