fix(test-harness): restore promisify(exec) + unblock CLI introspection probes
The vitest child-process guard wrapped exec/execFile without preserving the
`[util.promisify.custom]` symbol, so awaited `execAsync` resolved to a raw
stdout string instead of `{stdout, stderr}`. That single regression cascaded
through ~60 "failing" tests across cli, core, engine, and dashboard whose
production code was actually correct. Also relax the AI-CLI blocklist for
cheap introspection (--version/--help/which …), give SIGTERM'd subprocesses a
brief grace period before being flagged as "left running", fix a few real
test-side bugs uncovered along the way (executor mock step transitions, iOS
last-resort keyboard path, mission SSE replay tests racing with the real AI
agent), and convert dashboard route tests' dynamic `await import("../server.js")`
to static imports so first-test timings drop from 2–5s to <200ms.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -288,6 +288,9 @@ describe("useMobileKeyboard", () => {
|
||||
});
|
||||
|
||||
it("treats focused input + viewport shrink as keyboard-open even when overlap is 0", async () => {
|
||||
// iOS last-resort path: chromeOverlap = 0 (innerHeight tracks offsetTop+vv.height),
|
||||
// gap < 16 (focused-fallback doesn't fire), and viewportShrink >= 16 from the
|
||||
// baseline so the focused-input shrink heuristic is the only signal left.
|
||||
const { listeners, mockVV } = setupMobileVisualViewport({
|
||||
innerHeight: 844,
|
||||
vvHeight: 844,
|
||||
@@ -305,7 +308,17 @@ describe("useMobileKeyboard", () => {
|
||||
|
||||
input.focus();
|
||||
Object.defineProperty(mockVV, "height", {
|
||||
value: 826,
|
||||
value: 824,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(mockVV, "offsetTop", {
|
||||
value: 5,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(window, "innerHeight", {
|
||||
value: 829,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
@@ -316,7 +329,7 @@ describe("useMobileKeyboard", () => {
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.keyboardOverlap).toBe(0);
|
||||
expect(result.current.viewportHeight).toBe(826);
|
||||
expect(result.current.viewportHeight).toBe(824);
|
||||
expect(result.current.keyboardOpen).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user