diff --git a/tests/unit/channel-accounts-page.test.tsx b/tests/unit/channel-accounts-page.test.tsx index ffbc6409..603ba555 100644 --- a/tests/unit/channel-accounts-page.test.tsx +++ b/tests/unit/channel-accounts-page.test.tsx @@ -546,7 +546,7 @@ it('deep links open the single choice dialog and refresh preserves user choice', renderPage('/cloud-agents/channels?account=' + legacy.id + '&target=' + agentB.slug); const dialog = await screen.findByRole('dialog', { name: '更换智能体' }); expect(within(dialog).getByRole('radio', { name: agentB.name })).toBeChecked(); - expect(screen.getByTestId('location-path')).not.toHaveTextContent('target='); + await waitFor(() => expect(screen.getByTestId('location-path')).not.toHaveTextContent('target=')); expect(writes()).toEqual([]); }); it.each(['accounts', 'agents'])( diff --git a/tests/unit/cloud-agent-entry-navigation.test.tsx b/tests/unit/cloud-agent-entry-navigation.test.tsx index e27911e1..7cc40c3b 100644 --- a/tests/unit/cloud-agent-entry-navigation.test.tsx +++ b/tests/unit/cloud-agent-entry-navigation.test.tsx @@ -53,7 +53,11 @@ it('opens the card list from the home Agents choice without changing the remembe fireEvent.click(screen.getByTestId('ai-module-option-cloud_agents')); expect(await screen.findByRole('article', { name: draft.name })).toBeVisible(); - expect(await screen.findByRole('complementary', { name: '未确认的云端操作' })).toHaveTextContent('上次的问题'); + const records = await screen.findByRole('button', { name: '待处理记录(1)' }); + expect(screen.queryByRole('dialog', { name: '待处理记录' })).not.toBeInTheDocument(); + fireEvent.click(records); + expect(await screen.findByRole('dialog', { name: '待处理记录' })).toHaveTextContent('上次的问题'); + fireEvent.click(screen.getByRole('button', { name: '关闭记录' })); expect(router.state.location.pathname + router.state.location.search).toBe('/cloud-agents?view=mine'); expect(screen.queryByTestId('entry-editor')).not.toBeInTheDocument(); expect(api.get).not.toHaveBeenCalled();