Archived
tests/js: README lists all four suites and the render check
The README still named only the two suites that came out of the 2011-01 review; history.test.js and download.test.js shipped without a line, and render_align.js shipped without its invocation or its puppeteer prerequisite. A reviewer opening tests/js/ could not tell what to run or what each one guards. The render check gets its own section because it is not a unit test and cannot be: it needs Chrome, and it exists because three visual claims on this branch were made from the CSS and the SVG viewBox and all three were wrong. That is the argument for measuring the rendered page, and it belongs next to the tool that does it. Docs only, no code touched. Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
This commit is contained in:
1 parent
51db1729b1
commit
599d904e01
1 file changed
+38
-1
+38
-1
@@ -9,6 +9,41 @@ which has already happened once here.
|
||||
|
||||
node tests/js/poll_spark.test.js
|
||||
node tests/js/extremes.test.js
|
||||
node tests/js/history.test.js
|
||||
node tests/js/download.test.js
|
||||
|
||||
## What each one covers
|
||||
|
||||
| file | the shipped code it drives |
|
||||
| --- | --- |
|
||||
| `poll_spark.test.js` | `poll()`'s restart decision, the cadence fields, the sparkline |
|
||||
| `extremes.test.js` | `noteSample`, `triple`, `acceptTriple`, `resetWindows`, `newEngineRun` |
|
||||
| `history.test.js` | the history summary line: how it groups, and how it wraps |
|
||||
| `download.test.js` | the Requests-header JSON export: its markup and its handler |
|
||||
|
||||
Each asserts structure, not just text. `history.test.js` inspects the DOM the page builds and the
|
||||
CSS it ships, because the rules it guards -- a category wraps whole, the category break is a dot
|
||||
and the break within one is a pipe -- are not properties of any string the code builds.
|
||||
`download.test.js` invokes the click handler against stubs and checks it really builds a file,
|
||||
names it, clicks it and releases the blob URL: a button that looks clickable and does nothing is
|
||||
the failure it exists to catch.
|
||||
|
||||
## The render check (manual, needs Chrome)
|
||||
|
||||
`render_align.js` is not a unit test and cannot be: it answers whether the download glyph is
|
||||
level with the caption by loading the page in headless Chrome, screenshotting the header at 4x,
|
||||
and comparing the lowest inked pixel row of each. It needs puppeteer and a Chrome binary, which
|
||||
are deliberately not repo dependencies:
|
||||
|
||||
npm i puppeteer && npx puppeteer browsers install chrome
|
||||
node tests/js/render_align.js http://127.0.0.1:8800/
|
||||
|
||||
Exits nonzero when the two bottoms land on different device rows. Run it after touching glyph or
|
||||
header geometry. Three claims about alignment and spacing went through this branch on the strength
|
||||
of reading the CSS and the SVG viewBox, and all three were wrong -- collapsed whitespace made a
|
||||
"wide" separator zero pixels wide, and an SVG whose box is flush with the baseline still floats,
|
||||
because the baseline sits above the box bottom. None of that is visible in the source. Measure the
|
||||
rendered page.
|
||||
|
||||
## Why these are not in ctest
|
||||
|
||||
@@ -23,4 +58,6 @@ Both files came out of the 2026-11-01 dashboard review. Commit `9cc237f` claimed
|
||||
"18 checks execute the shipped noteSample, triple, acceptTriple, resetWindows and
|
||||
newEngineRun" while the harness lived only in `/tmp` — true when written, not
|
||||
reproducible by anyone else, which an independent review correctly rejected. They are
|
||||
in the tree so that claim can be re-run.
|
||||
in the tree so that claim can be re-run. `history.test.js` and `download.test.js` came from the
|
||||
dashboard work that followed, on the same rule: a check that lives in `/tmp` is a claim about the
|
||||
author's machine.
|
||||
Reference in new issue
Block a user