87b4f08e39
- 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.
23 lines
909 B
TypeScript
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 });
|
|
});
|
|
});
|