Skip to content

Commit 1db2c6e

Browse files
korthoutclaude
andcommitted
test: assert summary updates target the created comment id
The fake github already records both the id returned by createComment and the comment_id passed to each updateComment, but no test cross-referenced them. The orchestrator stores the id in a single closure variable (summaryCommentId) and reuses it, so confusion is unlikely — but a refactor that bound the wrong value (e.g. the PR number from the same scope) would slip through every existing test. The user-visible regression: initial 'is backporting…' placeholder never updates, users see a stale orphan comment for the rest of the run. One assertion in the happy-path summary test catches it without adding a dedicated test or duplicating setup. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 716c6c8 commit 1db2c6e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/test/backport.integration.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,13 @@ describe("Backport.run() orchestration", () => {
697697

698698
// Initial create + targets-known update + 2 per-target updates = 3 updates
699699
expect(github.updatedComments.length).toBeGreaterThanOrEqual(3);
700+
701+
// Every update targets the comment that was created
702+
const id = github.comments[0].id;
703+
expect(github.updatedComments.every((u) => u.comment_id === id)).toBe(
704+
true,
705+
);
706+
700707
const finalBody =
701708
github.updatedComments[github.updatedComments.length - 1].body;
702709
expect(finalBody).toContain("backported");

0 commit comments

Comments
 (0)