mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
docs: fix progress bar sizes for SKIP
This commit is contained in:
parent
11e428d471
commit
824c6041ab
1 changed files with 10 additions and 5 deletions
|
@ -7,13 +7,18 @@ function progressBar(totals) {
|
||||||
totalTests += value;
|
totalTests += value;
|
||||||
}
|
}
|
||||||
const passPercentage = Math.round(100 * totals["PASS"] / totalTests);
|
const passPercentage = Math.round(100 * totals["PASS"] / totalTests);
|
||||||
const skipPercentage = passPercentage + Math.round(100 * totals["PASS"] / totalTests);
|
const skipPercentage = passPercentage + Math.round(100 * totals["SKIP"] / totalTests);
|
||||||
|
|
||||||
|
// The ternary expressions are used for some edge-cases where there are no failing test,
|
||||||
|
// but still a red (or beige) line shows up because of how CSS draws gradients.
|
||||||
bar.style = `background: linear-gradient(
|
bar.style = `background: linear-gradient(
|
||||||
to right,
|
to right,
|
||||||
var(--PASS) ${passPercentage}%,
|
var(--PASS) ${passPercentage}%`
|
||||||
var(--SKIP) ${passPercentage}%,
|
+ ( passPercentage === 100 ? ", var(--PASS)" :
|
||||||
var(--SKIP) ${skipPercentage}%,
|
`, var(--SKIP) ${passPercentage}%,
|
||||||
var(--FAIL) 0)`;
|
var(--SKIP) ${skipPercentage}%`
|
||||||
|
)
|
||||||
|
+ (skipPercentage === 100 ? ")" : ", var(--FAIL) 0)");
|
||||||
|
|
||||||
const progress = document.createElement("div");
|
const progress = document.createElement("div");
|
||||||
progress.className = "progress"
|
progress.className = "progress"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue