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));