Don't clear buffers on cleanup. (#12979)

This commit is contained in:
Tommaso Sciortino
2025-11-12 19:20:21 -08:00
committed by GitHub
parent 5d27a62bec
commit 43916b98aa
2 changed files with 0 additions and 32 deletions
@@ -262,29 +262,5 @@ describe(`useKeypress`, () => {
expect(onKeypress).toHaveBeenCalledTimes(3);
});
it('should emit partial paste content if unmounted mid-paste', () => {
const { unmount } = renderKeypressHook(true);
const pasteText = 'incomplete paste';
act(() => stdin.write(PASTE_START + pasteText));
// No event should be fired yet.
expect(onKeypress).not.toHaveBeenCalled();
// Unmounting should trigger the flush.
unmount();
expect(onKeypress).toHaveBeenCalledTimes(1);
expect(onKeypress).toHaveBeenCalledWith({
name: '',
ctrl: false,
meta: false,
shift: false,
paste: true,
insertable: true,
sequence: pasteText,
});
});
});
});