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

View File

@@ -14,42 +14,54 @@ afterEach(() => {
});
describe('<HookStatusDisplay />', () => {
it('should render a single executing hook', () => {
it('should render a single executing hook', async () => {
const props = {
activeHooks: [{ name: 'test-hook', eventName: 'BeforeAgent' }],
};
const { lastFrame, unmount } = render(<HookStatusDisplay {...props} />);
const { lastFrame, waitUntilReady, unmount } = render(
<HookStatusDisplay {...props} />,
);
await waitUntilReady();
expect(lastFrame()).toMatchSnapshot();
unmount();
});
it('should render multiple executing hooks', () => {
it('should render multiple executing hooks', async () => {
const props = {
activeHooks: [
{ name: 'h1', eventName: 'BeforeAgent' },
{ name: 'h2', eventName: 'BeforeAgent' },
],
};
const { lastFrame, unmount } = render(<HookStatusDisplay {...props} />);
const { lastFrame, waitUntilReady, unmount } = render(
<HookStatusDisplay {...props} />,
);
await waitUntilReady();
expect(lastFrame()).toMatchSnapshot();
unmount();
});
it('should render sequential hook progress', () => {
it('should render sequential hook progress', async () => {
const props = {
activeHooks: [
{ name: 'step', eventName: 'BeforeAgent', index: 1, total: 3 },
],
};
const { lastFrame, unmount } = render(<HookStatusDisplay {...props} />);
const { lastFrame, waitUntilReady, unmount } = render(
<HookStatusDisplay {...props} />,
);
await waitUntilReady();
expect(lastFrame()).toMatchSnapshot();
unmount();
});
it('should return empty string if no active hooks', () => {
it('should return empty string if no active hooks', async () => {
const props = { activeHooks: [] };
const { lastFrame, unmount } = render(<HookStatusDisplay {...props} />);
expect(lastFrame()).toBe('');
const { lastFrame, waitUntilReady, unmount } = render(
<HookStatusDisplay {...props} />,
);
await waitUntilReady();
expect(lastFrame({ allowEmpty: true })).toBe('');
unmount();
});
});