feat(run): add TerminalView xterm.js component for the PTY transport

- TerminalView.tsx: xterm.js component with WebSocket attachment to /ws-pty/:runId
- Test: validates WS connection URL, incoming terminal data, and outgoing keystrokes
- Added ResizeObserver stub to test-setup.ts for jsdom environment
This commit is contained in:
2026-08-12 10:19:10 +07:00
parent 872c698132
commit 9b8d9bbe39
3 changed files with 168 additions and 0 deletions
+7
View File
@@ -16,6 +16,13 @@ import { afterEach, beforeEach } from "vitest";
import "./i18n/index";
import i18n from "i18next";
/** jsdom does not implement ResizeObserver — stub it for components that use it. */
// @ts-expect-error global stub
global.ResizeObserver = class {
observe() {}
disconnect() {}
};
/** Pin locale to English — LanguageDetector may otherwise pick up zh/vi from the host OS. */
beforeEach(() => {
i18n.changeLanguage("en");