mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-18 15:28:48 +03:00
test(cli-rs): fit four TUI tests to the composer and the children read
The session route now reads its children as TS does, so terminal.rs and root.rs route GET /api/session. Down past the newest history entry opens the composer, and a child session's composer leaves leader keys out, as in TS, so prompt.rs and actions.rs no longer rely on either.
This commit is contained in:
@@ -600,7 +600,8 @@ fn copies_and_the_parent_report_their_outcome() {
|
||||
vec![],
|
||||
);
|
||||
kit.ready();
|
||||
kit.leader("y");
|
||||
// A child session shows the composer, whose mode leaves the base-mode keys out (E.13b).
|
||||
kit.tui.keymap.dispatch("messages.copy", None);
|
||||
kit.wait_for("Failed to copy to clipboard");
|
||||
kit.tui.keymap.dispatch("session.copy.id", None);
|
||||
kit.wait_for("Failed to copy session ID");
|
||||
|
||||
@@ -391,7 +391,6 @@ fn history_steps_through_submitted_prompts_and_is_written_as_typescript_writes_i
|
||||
setup.app.press("down");
|
||||
assert_eq!(setup.textarea().text(), "second");
|
||||
setup.app.press("down");
|
||||
setup.app.press("down");
|
||||
assert_eq!(setup.textarea().text(), "");
|
||||
|
||||
// Up inside a multi-line prompt moves the cursor before it steps.
|
||||
|
||||
@@ -36,6 +36,7 @@ fn routes() -> Vec<MemoryRoute> {
|
||||
};
|
||||
vec![
|
||||
MemoryRoute::json("GET", "/api/location", 200, &location),
|
||||
MemoryRoute::json("GET", "/api/session", 200, &json!({ "data": [], "cursor": {} })),
|
||||
MemoryRoute::json("GET", "/api/agent", 200, &list(json!([agent]))),
|
||||
MemoryRoute::json("GET", "/api/model", 200, &list(json!([model]))),
|
||||
MemoryRoute::json(
|
||||
|
||||
@@ -36,6 +36,12 @@ fn routes(persistent_pty: bool) -> Vec<MemoryRoute> {
|
||||
"location": { "directory": "/project" },
|
||||
});
|
||||
let mut routes = vec![
|
||||
MemoryRoute::json(
|
||||
"GET",
|
||||
"/api/session",
|
||||
200,
|
||||
&json!({ "data": [], "cursor": {} }),
|
||||
),
|
||||
MemoryRoute::json(
|
||||
"GET",
|
||||
"/api/info",
|
||||
|
||||
Reference in New Issue
Block a user