From dc4fb2cd81099c2ad761d995a8e17304b386199c Mon Sep 17 00:00:00 2001 From: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> Date: Wed, 28 Oct 2026 07:07:33 +0800 Subject: [PATCH] test(workspace): start upward reading from a real scrollable end Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- .../personal-workspace-browser/conversation-activity.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/personal-workspace-browser/conversation-activity.mjs b/examples/personal-workspace-browser/conversation-activity.mjs index 8a0a6a8481..7750f8a250 100644 --- a/examples/personal-workspace-browser/conversation-activity.mjs +++ b/examples/personal-workspace-browser/conversation-activity.mjs @@ -161,6 +161,15 @@ export const conversationActivityScenario = { live.write(event(5, "answer.delta", { text: "\n\n" + "公开资料与待核实事项。\n\n".repeat(80) })); await page.getByText("公开资料与待核实事项。", { exact: true }).first().waitFor(); const scroller = page.locator(".personal-channel-scroll"); + // A responsive resize can leave scrollTop at zero before the follow + // frame runs. Start at a real end position so the next step moves up. + const startingPosition = await scroller.evaluate(node => { + node.scrollTop = node.scrollHeight; + node.dispatchEvent(new Event("scroll")); + return { top: node.scrollTop, remaining: node.scrollHeight - node.scrollTop - node.clientHeight }; + }); + assert.ok(startingPosition.top > 0 && startingPosition.remaining < 64, + "Exercise upward reading from the scrollable end, not an already-zero position"); await scroller.evaluate(node => { node.scrollTop = 0; node.dispatchEvent(new Event("scroll")); }); await page.getByRole("button", { name: "回到最新消息 ↓", exact: true }).waitFor(); live.write(event(6, "answer.delta", { text: "新增证据已经到达。" }));