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(bot-groups): 补强发送与真人署名安排卡回归覆盖 (#5613)

Chris Zhang7d3dbc9137fa
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts
index ae0453345f..353fef48f4 100644
--- a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts
+++ b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts
@@ -1180,7 +1180,9 @@ describe('Chat Server directed sends', () => {
for (const mode of ['all', 'mentioned'] as const) {
responseMode = mode;
for (const mentions of [{ all: true, botIds: [] }, { all: false, botIds: [] }]) {
+ const before = posts().length;
expect(await send(entry, mentions)).toMatchObject({ ok: true });
+ expect(posts()).toHaveLength(before + 1);
expect(posts().at(-1)![2].mentions).toEqual(mentions.all ? [botId, humanId] : []);
}
}
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/chatServerErrors.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/chatServerErrors.test.ts
index c04a434fec..ad6ff8e3a1 100644
--- a/apps/desktop/src/main/maker-ipc/__tests__/chatServerErrors.test.ts
+++ b/apps/desktop/src/main/maker-ipc/__tests__/chatServerErrors.test.ts
@@ -3,6 +3,7 @@ import { chatErrorDiagnostic, chatGroupFailure } from '../chatServerErrors.js';
describe('chat group errors', () => {
it.each([
+ ['MENTION_UNAVAILABLE', 'MENTION_UNAVAILABLE'],
['MEMBER_UNAVAILABLE', 'MEMBER_UNAVAILABLE'], ['INVALID_ATTACHMENT', 'INVALID_ATTACHMENT'],
['FILE_PEER_TIMEOUT', 'ATTACHMENT_UNAVAILABLE'], ['ATTACHMENT_TOO_LARGE', 'ATTACHMENT_TOO_LARGE'],
['MEDIA_UPLOAD_FAILED', 'MEDIA_UPLOAD_FAILED'], ['INVALID_MEDIA_URL', 'MEDIA_UPLOAD_FAILED'],
diff --git a/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsx b/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsx
index ef2d70eeb7..fbdae24753 100644
--- a/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsx
+++ b/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsx
@@ -385,10 +385,10 @@ describe('group timeline', () => {
expect(h.chat.act).toHaveBeenLastCalledWith('plan-edit', { planId: 'p1', position: 0, action: 'remove' });
});
- it('renders human-signed plans as organizer cards with working actions and read-only old plans', async () => {
+ it.each([undefined, true, false])('renders human-signed plans as organizer cards with working actions and read-only old plans (isSelf=%s)', async (isSelf) => {
const data = group();
data.messages = data.messages.map(message => message.kind === 'plan'
- ? { ...message, authorKind: 'user', authorBotId: null, authorName: 'Human creator' } : message);
+ ? { ...message, authorKind: 'user', authorBotId: null, authorName: 'Human creator', isSelf } : message);
await render(data);
expect(byId('botGroup.message.plan')?.textContent).toContain('咪咪');
expect(byId('botGroup.message.plan')?.textContent).not.toContain('Human creator');