swarm ui: the PR report's approvals column filters on whether the rule is met
The report had an approvals column (1/2) and a separate approved column. They are one fact, so approvals now carries the filter, complete or missing, and the approved column is gone.
This commit is contained in:
parent
cac9b40714
commit
71a4d1d255
1 changed files with 27 additions and 12 deletions
|
|
@ -2,6 +2,7 @@
|
|||
import assert from "node:assert/strict";
|
||||
import { test } from "node:test";
|
||||
import {
|
||||
approvalsState,
|
||||
approvalsText,
|
||||
diffSize,
|
||||
diffText,
|
||||
|
|
@ -78,3 +79,18 @@ test("a PR has all approvals when it meets the rule, and an unprotected base alw
|
|||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test("the approvals column filters on whether the rule is met", () => {
|
||||
assert.equal(approvalsState(row({})), "missing");
|
||||
assert.equal(approvalsState(row({ approvals: 2 })), "complete");
|
||||
assert.equal(
|
||||
approvalsState(
|
||||
row({
|
||||
targets_protected_branch: false,
|
||||
required_approvals: 0,
|
||||
approvals: 0,
|
||||
}),
|
||||
),
|
||||
"complete",
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue