Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

test(desktop): await history alert disposal effect

DavidShenb59e0130aefd
diff --git a/apps/desktop/src/renderer/features/bots/__tests__/botIslandVisibility.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/botIslandVisibility.test.tsx
index 2d64798822..3adf3d2eff 100644
--- a/apps/desktop/src/renderer/features/bots/__tests__/botIslandVisibility.test.tsx
+++ b/apps/desktop/src/renderer/features/bots/__tests__/botIslandVisibility.test.tsx
@@ -171,7 +171,8 @@ describe('history ownership gate disposes the clicked island card', () => {
get.mockResolvedValue({ ...profile, sessions: [{ id: 'old-a', kind: 'channel', role: 'channel', status }] });
const view = render(<BotHistorySessionView />);
await waitFor(() => expect(view.getByTestId('chat').dataset.readonly).toBe('true'));
- expect(consumeEntryAlert).toHaveBeenCalledExactlyOnceWith('old-a', '42');
+ // Rendering the transcript can precede the passive effect that disposes the alert.
+ await waitFor(() => expect(consumeEntryAlert).toHaveBeenCalledExactlyOnceWith('old-a', '42'));
});
it.each([