{showAbove &&
aboveLastToolCallSteps.map((step) =>
@@ -145,7 +151,10 @@ export function MessageGroup({
key={lastReasoningStep.id}
className="w-full items-start justify-start text-left"
variant="ghost"
- onClick={() => setShowLastThinking(!showLastThinking)}
+ onClick={(event) => {
+ event.stopPropagation();
+ setShowLastThinking((prev) => !prev);
+ }}
>
{
{ timeout: 30_000 },
);
});
+
+ test("streaming 中点击停止可中断输出", async ({ page }) => {
+ const threadId = uuid();
+ const text =
+ "请逐行输出 1 到 500 的数字,并在每一行前面加上“第N行:”前缀,不要省略。";
+
+ await openChat(page, newChatEntry(threadId));
+ await expect(page.getByTestId("welcome-suggestions")).toBeVisible();
+
+ await sendMessage(page, text);
+
+ const submitButton = page.locator("button[aria-label='Submit']");
+
+ await expect(submitButton).toHaveText("停止", { timeout: 30_000 });
+ await expect(submitButton).toBeEnabled();
+
+ await submitButton.click();
+
+ // 点击停止后应退出 streaming 态,按钮文本不再是“停止”
+ await expect(submitButton).toHaveText("发送", { timeout: 30_000 });
+ });
});