From 69e379190b72d112d2172f34ee1711f1c05c912f Mon Sep 17 00:00:00 2001 From: liugddx Date: Fri, 9 Oct 2026 10:12:31 +0800 Subject: [PATCH] test(desktop): click a mounted rail in the retry-while-filtered story RetryWhileWorkFiltered clicked the first .workhub-message-rail right after the send failed. The send follows the latest Turn, and the virtualized transcript can still be unmounting older Turns at that moment. Under CPU load the first rail (Turn 1) detached between user-event's hover and press, so pointerdown and click went to a node outside the document: nothing handled them, user-event raised no error, and the filter never appeared. Click the newest linked Turn's rail instead, which stays mounted while the transcript follows the latest Turn. Fixes #5995. Generated-by: Claude Code Co-Authored-By: Claude Opus 5.5 (1M context) --- apps/desktop/stories/workhub.stories.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/desktop/stories/workhub.stories.tsx b/apps/desktop/stories/workhub.stories.tsx index 819e624c9d4..ba3f55f7cc0 100644 --- a/apps/desktop/stories/workhub.stories.tsx +++ b/apps/desktop/stories/workhub.stories.tsx @@ -685,7 +685,12 @@ export const RetryWhileWorkFiltered: Story = { await userEvent.click(editor); await userEvent.keyboard('FILTERED_RETRY_PROBE{Enter}'); await waitFor(() => expect(canvas.getByRole('alert')).toHaveTextContent('Temporary Host failure')); - await userEvent.click(canvasElement.querySelector('.workhub-message-rail') as HTMLElement); + // The send follows the latest Turn, and the virtualized transcript may still + // be unmounting older Turns when the failure lands. Clicking the first rail + // could target a node that detaches between hover and press (#5995); the + // newest linked Turn's rail stays mounted while following the latest Turn. + const rails = canvasElement.querySelectorAll('.workhub-message-rail'); + await userEvent.click(rails[rails.length - 1]!); await waitFor(() => expect(canvas.getByRole('button', { name: '显示全部对话' })).toBeInTheDocument()); await userEvent.click(canvas.getByRole('button', { name: /^重试$/ })); await waitFor(() => expect(writes.answer).toHaveBeenCalledTimes(2));