Skip to content

Commit aa3fe24

Browse files
committed
test(queue): fix reopen-reclose CI failure test's stale event timeline
The new outcome:error regression test's /issues/42/events mock lacked a "reopened" event for the payload's actual reopener, so the #2369 live recheck #3 (reopenerSuperseded) denied the close before ever reaching the PATCH-fails path this test targets. Add the missing "reopened" event, matching the pattern already used by every other reopen-reclose test in this file.
1 parent 66a141e commit aa3fe24

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/unit/queue.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11688,7 +11688,9 @@ describe("one-shot reopen prevention", () => {
1168811688
if (url.includes("/access_tokens")) return Response.json({ token: "installation-token" });
1168911689
if (url.endsWith("/collaborators/contributor/permission")) return Response.json({ permission: "read" });
1169011690
if (url.endsWith("/collaborators/maintainer/permission")) return Response.json({ permission: "write" });
11691-
if (url.includes("/issues/42/events")) return Response.json([{ event: "closed", actor: { login: "maintainer" } }]);
11691+
// "contributor" (the payload's reopener) must be the MOST RECENT "reopened" actor in the timeline, or the
11692+
// #2369 live-recheck #3 (reopenerSuperseded) denies before ever reaching the close attempt this test targets.
11693+
if (url.includes("/issues/42/events")) return Response.json([{ event: "closed", actor: { login: "maintainer" } }, { event: "reopened", actor: { login: "contributor" } }]);
1169211694
if (url.endsWith("/issues/42/comments")) return Response.json({ id: 99 }, { status: 201 }); // the courtesy comment succeeds
1169311695
if (url.endsWith("/pulls/42") && method === "PATCH") return new Response("forbidden", { status: 403 }); // the close itself fails
1169411696
return new Response("not found", { status: 404 });

0 commit comments

Comments
 (0)