mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 20:08:26 +00:00
refactor(tui): dedupe handlers and formatter test setup
This commit is contained in:
@@ -1,26 +1,6 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
createEditorSubmitHandler,
|
||||
createSubmitBurstCoalescer,
|
||||
shouldEnableWindowsGitBashPasteFallback,
|
||||
} from "./tui.js";
|
||||
|
||||
function createSubmitHarness() {
|
||||
const editor = {
|
||||
setText: vi.fn(),
|
||||
addToHistory: vi.fn(),
|
||||
};
|
||||
const handleCommand = vi.fn();
|
||||
const sendMessage = vi.fn();
|
||||
const handleBangLine = vi.fn();
|
||||
const onSubmit = createEditorSubmitHandler({
|
||||
editor,
|
||||
handleCommand,
|
||||
sendMessage,
|
||||
handleBangLine,
|
||||
});
|
||||
return { editor, handleCommand, sendMessage, handleBangLine, onSubmit };
|
||||
}
|
||||
import { createSubmitHarness } from "./tui-submit-test-helpers.js";
|
||||
import { createSubmitBurstCoalescer, shouldEnableWindowsGitBashPasteFallback } from "./tui.js";
|
||||
|
||||
describe("createEditorSubmitHandler", () => {
|
||||
it("routes lines starting with ! to handleBangLine", () => {
|
||||
|
||||
Reference in New Issue
Block a user