test(coder): add unit test for active goal status bar display

5fdf058ac5ce · AtlantisPleb · · parent d1abc9e8a2f7

test(coder): add unit test for active goal status bar display

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • modified packages/openagents-cli/test/coder-ui.test.ts

Diff

1 file changed, +36 -0

packages/openagents-cli/test/coder-ui.test.ts modified +36

@@ -3,6 +3,7 @@ import { describe, expect, it } from "vitest";

3 3
4 4
import { CODER_BACKENDS } from "../src/coder-backends.js";
5 5
import { CoderSession, type ReplyChunk, type ReplySource } from "../src/coder-session.js";
6
import { InMemoryGoalStore } from "../src/coder-goals.js";
6 7
import { CoderTaskRegistry } from "../src/coder-tasks.js";
7 8
import { RELOAD_EXIT_CODE } from "../src/coder-reload.js";
8 9
import { runCoderUi } from "../src/coder-ui.js";

@@ -1221,3 +1222,38 @@ describe("inspecting a child from the column", () => {

1221 1222
1222 1223
  const drillKeys = async () => driveKeys(two, [[], ["\x1b[C"], ["\x1b[D"]]);
1223 1224
});
1225
1226
describe("active goal status bar display", () => {
1227
  it("renders active goal in bottom status line", async () => {
1228
    const out = new FakeOut();
1229
    out.columns = 120;
1230
    const input = new FakeIn();
1231
1232
    const goalStore = new InMemoryGoalStore();
1233
    goalStore.setGoal("Build persistent task goals", 50000);
1234
1235
    const session = new CoderSession(
1236
      source([]),
1237
      "repo",
1238
      "main",
1239
      undefined,
1240
      undefined,
1241
      undefined,
1242
      undefined,
1243
      undefined,
1244
      goalStore,
1245
    );
1246
1247
    const done = runCoderUi(session, {
1248
      stdin: input as unknown as NodeJS.ReadStream,
1249
      stdout: out as unknown as NodeJS.WriteStream,
1250
    });
1251
1252
    await new Promise((resolve) => setTimeout(resolve, 20));
1253
    expect(out.written).toContain('goal: "Build persistent task');
1254
    expect(out.written).toContain('…"');
1255
1256
    input.emit("data", "\x04");
1257
    await done;
1258
  });
1259
});

This page updates live while a promote is in flight · changelog