mirror of
https://github.com/github/awesome-copilot.git
synced 2026-10-14 07:44:43 +00:00
fix(canvas): exclude pending decisions from review count
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc011747-d114-43af-93e9-7f0036f9b4b7
This commit is contained in:
co-authored by
Copilot App
parent
c0fb55cd28
commit
7c0da121fa
@@ -146,7 +146,7 @@ function findItem(number) {
|
||||
|
||||
function pendingReviewCount() {
|
||||
return board
|
||||
? board.items.filter((item) => !item.decision && item.reviewStatus !== "reviewed" && item.reviewStatus !== "queued").length
|
||||
? board.items.filter((item) => !item.decision && !item.pendingDecision && item.reviewStatus !== "reviewed" && item.reviewStatus !== "queued").length
|
||||
: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,6 +127,18 @@ for (const boardName of ["open-pr-board", "external-plugin-review-board"]) {
|
||||
});
|
||||
}
|
||||
|
||||
test("external-plugin-review-board: pending review count excludes posted decisions", async () => {
|
||||
const ui = await createUI("external-plugin-review-board", [
|
||||
{ number: 1, reviewStatus: "unreviewed" },
|
||||
{ number: 2, reviewStatus: "unreviewed", pendingDecision: { kind: "approve" } },
|
||||
{ number: 3, reviewStatus: "reviewed" },
|
||||
{ number: 4, reviewStatus: "queued" },
|
||||
{ number: 5, decision: { kind: "reject" } },
|
||||
]);
|
||||
|
||||
assert.equal(ui.context.pendingReviewCount(), 1);
|
||||
});
|
||||
|
||||
test("PR bulk close requires and posts the staged reason", async () => {
|
||||
const ui = await createUI("open-pr-board", [{ number: 1, column: "close", review: { suggestedComment: "Duplicate" } }]);
|
||||
await ui.context.bulkAction("close", "close");
|
||||
|
||||
Reference in New Issue
Block a user