1
0
forked from rosa/hakurei

21 Commits

Author SHA1 Message Date
Kat
fb47282905 TODO: docs maybe?? 2026-03-23 02:19:58 +11:00
Kat
2ef1f0100c TODO: consider dom sandbox for testing ui (see long desc)
see https://discord.com/channels/1388415325036609617/1458088018232479824/1484195713347879012
2026-03-23 02:19:58 +11:00
Kat
6760efec54 TODO: target-specific tests 2026-03-23 02:19:58 +11:00
Kat
676b189cf0 TODO: actually write tests lol 2026-03-23 02:19:58 +11:00
Kat
96f8565321 TODO: relocate test code 2026-03-23 02:19:58 +11:00
Kat
e6b315be80 TODO: parallel execution 2026-03-23 02:19:58 +11:00
Kat
79b909e293 TODO: implement skipping from run() (use substring-matching for entering tests to skip) 2026-03-23 02:19:58 +11:00
Kat
c3eed03998 cmd/pkgserver: aria-describe test node summary with state
The summary marker does not appear in the AOM, so setting its alt text
is fruitless.
2026-03-23 02:19:58 +11:00
Kat
ff0cff0488 cmd/pkgserver: provide role descriptions for test nodes in web UI 2026-03-23 02:19:58 +11:00
Kat
09379cef7d cmd/pkgserver: fix dark mode in test web UI 2026-03-23 02:19:58 +11:00
Kat
2a7d917c06 cmd/pkgserver: serialize JS enums as ints instead of strings 2026-03-23 02:19:58 +11:00
Kat
fb4226aaee cmd/pkgserver: set exit code when running JS tests from CLI 2026-03-23 02:19:58 +11:00
Kat
cc91d1e298 cmd/pkgserver: expose verbose StreamReporter flag via CLI 2026-03-23 02:19:58 +11:00
Kat
18962dcbb3 cmd/pkgserver: implement skipping JS tests from the DSL 2026-03-23 02:19:58 +11:00
Kat
8e3ecda93e cmd/pkgserver: allow non-global JS test suites 2026-03-23 02:19:58 +11:00
Kat
cfc4ef9822 cmd/pkgserver: serialize raw log list for go test consumption 2026-03-23 02:19:58 +11:00
Kat
03aba72900 cmd/pkgserver: add JSON reporter to facilitate go test integration 2026-03-23 02:19:58 +11:00
Kat
0e4ecda19f cmd/pkgserver: fix multi-line JS test output display 2026-03-23 02:19:58 +11:00
Kat
2b9cc602fa cmd/pkgserver: implement JS test DSL and runner 2026-03-23 02:19:58 +11:00
Kat
ee0983ef01 cmd/pkgserver: move StreamReporter display() to Reporter interface 2026-03-23 02:19:58 +11:00
Kat
e5aa3918ab cmd/pkgserver: add DOM reporter for JS tests 2026-03-23 02:19:58 +11:00
3 changed files with 23 additions and 13 deletions

View File

@@ -44,24 +44,24 @@ details.test-node {
* [3]: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/summary#changing_the_summarys_icon
*/
color: var(--fg);
content: url("/static/success-closed.svg");
content: url("/static/success-closed.svg") / "success";
}
&.success[open] > summary::marker {
content: url("/static/success-open.svg");
content: url("/static/success-open.svg") / "success";
}
&.failure > summary::marker {
color: red;
content: url("/static/failure-closed.svg");
content: url("/static/failure-closed.svg") / "failure";
}
&.failure[open] > summary::marker {
content: url("/static/failure-open.svg");
content: url("/static/failure-open.svg") / "failure";
}
&.skip > summary::marker {
color: blue;
content: url("/static/skip-closed.svg");
content: url("/static/skip-closed.svg") / "skip";
}
&.skip[open] > summary::marker {
content: url("/static/skip-open.svg");
content: url("/static/skip-open.svg") / "skip";
}
}

View File

@@ -293,20 +293,25 @@ export class DOMReporter implements Reporter {
let parent = document.getElementById("root");
for (const node of path) {
let child = null;
let child: HTMLDetailsElement;
let summary: HTMLElement;
outer: for (const d of parent.children) {
if (!(d instanceof HTMLDetailsElement)) continue;
for (const s of d.children) {
if (!(s instanceof HTMLElement)) continue;
if (!(s.tagName === "SUMMARY" && s.innerText === node)) continue;
child = d;
summary = s;
break outer;
}
}
if (child === null) {
if (!child) {
child = document.createElement("details");
child.className = "test-node";
const summary = document.createElement("summary");
child.ariaRoleDescription = "test";
summary = document.createElement("summary");
summary.appendChild(document.createTextNode(node));
summary.ariaRoleDescription = "test name";
child.appendChild(summary);
parent.appendChild(child);
}
@@ -317,17 +322,18 @@ export class DOMReporter implements Reporter {
child.classList.add("failure");
child.classList.remove("skip");
child.classList.remove("success");
summary.setAttribute("aria-labelledby", "failure-description");
break;
case "skip":
if (child.classList.contains("failure")) break;
child.classList.add("skip");
child.classList.remove("success");
summary.setAttribute("aria-labelledby", "skip-description");
break;
case "success":
if (!(child.classList.contains("failure") ||
child.classList.contains("skip"))) {
child.classList.add("success")
}
if (child.classList.contains("failure") || child.classList.contains("skip")) break;
child.classList.add("success");
summary.setAttribute("aria-labelledby", "success-description");
break;
}

View File

@@ -15,6 +15,10 @@
failed<span id="skip-counter-text" class="hidden">, <span id="skip-counter">0</span> skipped</span>.
</p>
<p hidden id="success-description">Successful test</p>
<p hidden id="failure-description">Failed test</p>
<p hidden id="skip-description">Partially or fully skipped test</p>
<div id="root">
</div>