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
@@ -14,46 +14,54 @@ vi.mock('../../utils/commandUtils.js', () => ({
}));
describe('UserMessage', () => {
it('renders normal user message with correct prefix', () => {
const { lastFrame } = renderWithProviders(
it('renders normal user message with correct prefix', async () => {
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
<UserMessage text="Hello Gemini" width={80} />,
{ width: 80 },
);
await waitUntilReady();
const output = lastFrame();
expect(output).toMatchSnapshot();
unmount();
});
it('renders slash command message', () => {
const { lastFrame } = renderWithProviders(
it('renders slash command message', async () => {
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
<UserMessage text="/help" width={80} />,
{ width: 80 },
);
await waitUntilReady();
const output = lastFrame();
expect(output).toMatchSnapshot();
unmount();
});
it('renders multiline user message', () => {
it('renders multiline user message', async () => {
const message = 'Line 1\nLine 2';
const { lastFrame } = renderWithProviders(
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
<UserMessage text={message} width={80} />,
{ width: 80 },
);
await waitUntilReady();
const output = lastFrame();
expect(output).toMatchSnapshot();
unmount();
});
it('transforms image paths in user message', () => {
it('transforms image paths in user message', async () => {
const message = 'Check out this image: @/path/to/my-image.png';
const { lastFrame } = renderWithProviders(
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
<UserMessage text={message} width={80} />,
{ width: 80 },
);
await waitUntilReady();
const output = lastFrame();
expect(output).toContain('[Image my-image.png]');
expect(output).toMatchSnapshot();
unmount();
});
});