fix ctrl c conflict behavior

This commit is contained in:
cynthialong0-0
2026-05-13 16:46:27 +00:00
parent 8cda688fe2
commit 83f46557c0
2 changed files with 43 additions and 5 deletions
+17
View File
@@ -2127,6 +2127,23 @@ describe('AppContainer State Management', () => {
});
describe('CTRL+C', () => {
it('should not trigger quit flow when input buffer has text', async () => {
mockedUseTextBuffer.mockReturnValue({
text: 'hello world',
setText: vi.fn(),
lines: ['hello world'],
cursor: [0, 11],
handleInput: vi.fn().mockReturnValue(false),
});
await setupKeypressTest();
pressKey('\x03'); // Ctrl+C
expect(mockCancelOngoingRequest).not.toHaveBeenCalled();
expect(mockHandleSlashCommand).not.toHaveBeenCalled();
unmount();
});
it('should cancel ongoing request on first press', async () => {
mockedUseGeminiStream.mockReturnValue({
...DEFAULT_GEMINI_STREAM_MOCK,