- 0 succeeded, 0 failed.
+ 0 succeeded, 0
+ failed, 0 skipped.
+Successful test
+Failed test
+Partially or fully skipped test
+
diff --git a/cmd/pkgserver/ui_test/lib/ui.scss b/cmd/pkgserver/ui_test/lib/ui.scss
index 16bc37ec..2036ef73 100644
--- a/cmd/pkgserver/ui_test/lib/ui.scss
+++ b/cmd/pkgserver/ui_test/lib/ui.scss
@@ -1,3 +1,8 @@
+/*
+ * If updating the theme colors, also update them in success-closed.svg and
+ * success-open.svg!
+ */
+
:root {
--bg: #d3d3d3;
--fg: black;
@@ -34,8 +39,39 @@ details.test-node {
> summary {
cursor: pointer;
}
+ &.success > summary::marker {
+ /*
+ * WebKit only supports color and font-size properties in ::marker [1],
+ * and its ::-webkit-details-marker only supports hiding the marker
+ * entirely [2], contrary to mdn's example [3]; thus, set a color as
+ * a fallback: while it may not be accessible for colorblind
+ * individuals, it's better than no indication of a test's state for
+ * anyone, as that there's no other way to include an indication in the
+ * marker on WebKit.
+ *
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/::marker#browser_compatibility
+ * [2]: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/summary#default_style
+ * [3]: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/summary#changing_the_summarys_icon
+ */
+ color: var(--fg);
+ content: url("/testui/success-closed.svg") / "success";
+ }
+ &.success[open] > summary::marker {
+ content: url("/testui/success-open.svg") / "success";
+ }
&.failure > summary::marker {
color: red;
+ content: url("/testui/failure-closed.svg") / "failure";
+ }
+ &.failure[open] > summary::marker {
+ content: url("/testui/failure-open.svg") / "failure";
+ }
+ &.skip > summary::marker {
+ color: blue;
+ content: url("/testui/skip-closed.svg") / "skip";
+ }
+ &.skip[open] > summary::marker {
+ content: url("/testui/skip-open.svg") / "skip";
}
}
diff --git a/cmd/pkgserver/ui_test/sample_tests.ts b/cmd/pkgserver/ui_test/sample_tests.ts
index d3a9dfed..8d1b5526 100644
--- a/cmd/pkgserver/ui_test/sample_tests.ts
+++ b/cmd/pkgserver/ui_test/sample_tests.ts
@@ -37,6 +37,10 @@ suite("cat", [
test("likes headpats", (t) => {
t.log("meow");
}),
+ test("owns skipping rope", (t) => {
+ t.skip("this cat is stuck in your machine!");
+ t.log("never logged");
+ }),
test("tester tester", (t) => {
const r = new TestRegistrar();
r.suite("explod", [
@@ -73,7 +77,7 @@ suite("cat", [
result.path[1] === "with yarn")) {
t.error(`incorrect result path got=${result.path} want=["explod", "with yarn"]`);
}
- if (!result.success) t.error(`expected test to succeed`);
+ if (result.state !== "success") t.error(`expected test to succeed`);
if (!(result.logs.length === 1 && result.logs[0] === "YAY")) {
t.error(`incorrect result logs got=${result.logs} want=["YAY"]`);
}