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
@@ -21,7 +21,7 @@ vi.mock('../contexts/SessionContext.js', async (importOriginal) => {
const useSessionStatsMock = vi.mocked(SessionContext.useSessionStats);
const renderWithMockedStats = (metrics: SessionMetrics) => {
const renderWithMockedStats = async (metrics: SessionMetrics) => {
useSessionStatsMock.mockReturnValue({
stats: {
sessionId: 'test-session',
@@ -35,13 +35,18 @@ const renderWithMockedStats = (metrics: SessionMetrics) => {
startNewPrompt: vi.fn(),
});
return renderWithProviders(<SessionSummaryDisplay duration="1h 23m 45s" />, {
width: 100,
});
const result = renderWithProviders(
<SessionSummaryDisplay duration="1h 23m 45s" />,
{
width: 100,
},
);
await result.waitUntilReady();
return result;
};
describe('<SessionSummaryDisplay />', () => {
it('renders the summary display with a title', () => {
it('renders the summary display with a title', async () => {
const metrics: SessionMetrics = {
models: {
'gemini-2.5-pro': {
@@ -77,10 +82,11 @@ describe('<SessionSummaryDisplay />', () => {
},
};
const { lastFrame } = renderWithMockedStats(metrics);
const { lastFrame, unmount } = await renderWithMockedStats(metrics);
const output = lastFrame();
expect(output).toContain('Agent powering down. Goodbye!');
expect(output).toMatchSnapshot();
unmount();
});
});