Migrate core render util to use xterm.js as part of the rendering loop. (#19044)

This commit is contained in:
Jacob Richman
2026-02-18 16:46:50 -08:00
committed by GitHub
parent 04c52513e7
commit 04f65f3d55
213 changed files with 7065 additions and 3852 deletions
@@ -39,15 +39,17 @@ describe('QuittingDisplay', () => {
mockUseTerminalSize.mockReturnValue({ rows: 20, columns: 80 });
});
it('renders nothing when no quitting messages', () => {
it('renders nothing when no quitting messages', async () => {
mockUseUIState.mockReturnValue({
quittingMessages: null,
} as unknown as UIState);
const { lastFrame } = render(<QuittingDisplay />);
expect(lastFrame()).toBe('');
const { lastFrame, waitUntilReady, unmount } = render(<QuittingDisplay />);
await waitUntilReady();
expect(lastFrame({ allowEmpty: true })).toBe('');
unmount();
});
it('renders quitting messages', () => {
it('renders quitting messages', async () => {
const mockMessages = [
{ id: '1', type: 'user', content: 'Goodbye' },
{ id: '2', type: 'model', content: 'See you later' },
@@ -56,8 +58,10 @@ describe('QuittingDisplay', () => {
quittingMessages: mockMessages,
constrainHeight: false,
} as unknown as UIState);
const { lastFrame } = render(<QuittingDisplay />);
const { lastFrame, waitUntilReady, unmount } = render(<QuittingDisplay />);
await waitUntilReady();
expect(lastFrame()).toContain('Goodbye');
expect(lastFrame()).toContain('See you later');
unmount();
});
});