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
@@ -66,52 +66,63 @@ useSessionStatsMock.mockReturnValue({
});
describe('Gradient Crash Regression Tests', () => {
it('<Header /> should not crash when theme.ui.gradient is empty', () => {
const { lastFrame } = renderWithProviders(
it('<Header /> should not crash when theme.ui.gradient is empty', async () => {
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
<Header version="1.0.0" nightly={false} />,
{
width: 120,
},
);
await waitUntilReady();
expect(lastFrame()).toBeDefined();
unmount();
});
it('<ModelDialog /> should not crash when theme.ui.gradient is empty', () => {
const { lastFrame } = renderWithProviders(
<ModelDialog onClose={() => {}} />,
it('<ModelDialog /> should not crash when theme.ui.gradient is empty', async () => {
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
<ModelDialog onClose={async () => {}} />,
{
width: 120,
},
);
await waitUntilReady();
expect(lastFrame()).toBeDefined();
unmount();
});
it('<Banner /> should not crash when theme.ui.gradient is empty', () => {
const { lastFrame } = renderWithProviders(
it('<Banner /> should not crash when theme.ui.gradient is empty', async () => {
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
<Banner bannerText="Test Banner" isWarning={false} width={80} />,
{
width: 120,
},
);
await waitUntilReady();
expect(lastFrame()).toBeDefined();
unmount();
});
it('<Footer /> should not crash when theme.ui.gradient has only one color (or empty) and nightly is true', () => {
const { lastFrame } = renderWithProviders(<Footer />, {
width: 120,
uiState: {
nightly: true, // Enable nightly to trigger Gradient usage logic
sessionStats: mockSessionStats,
it('<Footer /> should not crash when theme.ui.gradient has only one color (or empty) and nightly is true', async () => {
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
<Footer />,
{
width: 120,
uiState: {
nightly: true, // Enable nightly to trigger Gradient usage logic
sessionStats: mockSessionStats,
},
},
});
);
await waitUntilReady();
// If it crashes, this line won't be reached or lastFrame() will throw
expect(lastFrame()).toBeDefined();
// It should fall back to rendering text without gradient
expect(lastFrame()).not.toContain('Gradient');
unmount();
});
it('<StatsDisplay /> should not crash when theme.ui.gradient is empty', () => {
const { lastFrame } = renderWithProviders(
it('<StatsDisplay /> should not crash when theme.ui.gradient is empty', async () => {
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
<StatsDisplay duration="1s" title="My Stats" />,
{
width: 120,
@@ -120,8 +131,10 @@ describe('Gradient Crash Regression Tests', () => {
},
},
);
await waitUntilReady();
expect(lastFrame()).toBeDefined();
// Ensure title is rendered
expect(lastFrame()).toContain('My Stats');
unmount();
});
});