Files
oh-my-pi/packages/coding-agent/test/modes/controllers/input-controller-tool-expansion.test.ts
T
can1357 87b4f08e39 fix(coding-agent/modes): allowed unknown viewport mutation during tool expansion
- Updated toggleToolOutputExpansion to pass allowUnknownViewportMutation when requesting render.
- Added a test that verifies tool output toggling sets expansion state and calls requestRender with the new flag.
- Documented the Ctrl+O POSIX tool-result expansion scrollback fix in the changelog.
2026-05-31 12:44:26 +02:00

23 lines
909 B
TypeScript

import { describe, expect, it, vi } from "bun:test";
import { InputController } from "../../../src/modes/controllers/input-controller";
import type { InteractiveModeContext } from "../../../src/modes/types";
describe("InputController tool output expansion", () => {
it("allows unknown viewport mutation when toggling tool output expansion", () => {
const expandable = { setExpanded: vi.fn() };
const inert = { render: vi.fn(() => []) };
const requestRender = vi.fn();
const ctx = {
toolOutputExpanded: false,
chatContainer: { children: [expandable, inert] },
ui: { requestRender },
} as unknown as InteractiveModeContext;
new InputController(ctx).toggleToolOutputExpansion();
expect(ctx.toolOutputExpanded).toBe(true);
expect(expandable.setExpanded).toHaveBeenCalledWith(true);
expect(requestRender).toHaveBeenCalledWith(false, { allowUnknownViewportMutation: true });
});
});