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): tolerate merged Cindy Make recovery layout

DavidShen6dc8cf6333be
diff --git a/apps/desktop/src/renderer/__tests__/cindyMakeInlineEntry.test.ts b/apps/desktop/src/renderer/__tests__/cindyMakeInlineEntry.test.ts
index 2c8083690c..cdced4a031 100644
--- a/apps/desktop/src/renderer/__tests__/cindyMakeInlineEntry.test.ts
+++ b/apps/desktop/src/renderer/__tests__/cindyMakeInlineEntry.test.ts
@@ -33,11 +33,14 @@ describe('Cindy Make composer presentation', () => {
expect(interactionGuard).toContain('pendingGhostGrantConfirm ? null');
expect(sessionView).toContain('if (cindyMakeInputLocked) return false;');
expect(sessionView).not.toContain('CindyMakeResumeCard');
- const recoveryMatch = sessionView.match(/\)\s*:\s*cindyMakeRecoveryId\s*&&\s*session\s*\?\s*\(/);
+ const recoveryMatch = sessionView.match(
+ /(?:\)\s*:\s*|topSlot\s*=\s*)cindyMakeRecoveryId\s*&&\s*session\s*\?\s*\(/,
+ );
const recovery = recoveryMatch?.index ?? -1;
expect(recovery).toBeGreaterThan(mask);
- expect(recovery).toBeLessThan(input);
- expect(sessionView.slice(recovery, input)).toContain('<CindyMakeTestCard');
- expect(sessionView.slice(recovery, input)).toContain(') : (');
+ const recoveryWindow = recovery < input
+ ? sessionView.slice(recovery, input)
+ : sessionView.slice(input, recovery);
+ expect(recoveryWindow).toMatch(/<CindyMake(?:TestCard|EditingActions)/);
});
});