From 2fa25b36550fe3a903112417500f21ec7fd724b6 Mon Sep 17 00:00:00 2001 From: zhyongrui Date: Tue, 17 Mar 2026 16:42:59 +0000 Subject: [PATCH] feat: implement issue #126 --- src/commands/openclawcode.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/commands/openclawcode.test.ts b/src/commands/openclawcode.test.ts index 618044fe31..2b9095ed7a 100644 --- a/src/commands/openclawcode.test.ts +++ b/src/commands/openclawcode.test.ts @@ -1306,6 +1306,24 @@ describe("openclawCodeRunCommand", () => { expect(payload.publishedPullRequestOpenedAt).toBe("2026-01-01T00:00:00.000Z"); }); + it("marks publishedPullRequestHasNumber true when the stored number contains at least one entry", async () => { + mocks.runIssueWorkflow.mockResolvedValue( + createRun({ + draftPullRequest: { + ...createRun().draftPullRequest!, + number: [42], + }, + }), + ); + + await openclawCodeRunCommand({ issue: "2", repoRoot: "/repo", json: true }, runtime); + + const payload = JSON.parse(runtime.log.mock.calls[0]?.[0] ?? "null"); + expect(payload.pullRequestPublished).toBe(true); + expect(payload.publishedPullRequestNumber).toEqual([42]); + expect(payload.publishedPullRequestHasNumber).toBe(true); + }); + it("treats blank published pull request bodies as absent in convenience signals", async () => { mocks.runIssueWorkflow.mockResolvedValue( createRun({