commit ff6dbcba51c36593fbf872b42c6be85bdbc9ebb3
parent bd7c3b96ab2eeb4d14eee7e1eda51e167a702e42
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 6 Nov 2026 00:26:01 -0500
umtool: instruments.spec reads its seconds from the fixture's schedule
The fixture cut's length follows make-fixture's render block (8.7 s there,
7.9 with a bare one): the spec seeks to a row's second and the cut's end
rather than to fixed seconds.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/umtool/e2e/instruments.spec.ts b/umtool/e2e/instruments.spec.ts
@@ -13,9 +13,10 @@ import * as urls from "./urls";
//
// Fixture: e2e/fixtures/instruments-fixture.mjs -- the Play cut with
// deck.dial/odometer/trail on and a built schedule carrying six rows of the
-// measure (w07 stated >240 at 0.6 s, w21 remembered ≈390 at 1.2, w27 goal 250
-// at 2.0, w64 lost 31 at 2.6, w115 stated <300 at 6.1, w118 stated 291.5 at
-// 6.5; the cut is 7.9 s). The chrome preview without `estimate` reads that
+// measure (w07 stated >240 0.6 s into c01, w21 remembered ≈390 at c01 +1.2,
+// w27 goal 250 at c02 +0.4, w64 lost 31 at c02 +1.0, w115 stated <300 at c04
+// +0.2, w118 stated 291.5 at c04 +0.6; the spec reads the seconds back from
+// the fixture's schedule). The chrome preview without `estimate` reads that
// schedule. (Play the cut composes on the estimate's clock: the instruments
// join it there once the build's measure producer puts the slice in the
// estimate.)
@@ -25,6 +26,12 @@ const HERE = path.dirname(fileURLToPath(import.meta.url));
const PROJECT = "reports/instruments-fixture";
const DIR = path.join(HERE, "..", ".e2e-song", "reports", "instruments-fixture");
const manifest = () => JSON.parse(readFileSync(path.join(DIR, "video.manifest.json"), "utf8"));
+/** The fixture's schedule (its seconds are the estimate's on this machine's fixture render block). */
+const schedule = () => JSON.parse(readFileSync(path.join(DIR, "out", "sourced", "schedule.json"), "utf8")) as { total: number; measure: { events: { row: string; t: number }[] } };
+/** A cut second: a row's, plus `after`. */
+const tOf = (row: string, after = 0) => schedule().measure.events.find((e) => e.row === row)!.t + after;
+/** The cut's last moment. */
+const tEnd = () => schedule().total - 0.05;
type Layer = { id: string; z?: number; region?: string; ready?: string; src?: string; error?: string; off?: string; geometry?: { x: number; y: number; width: number; height: number } };
@@ -108,8 +115,9 @@ test("the dial's page posts dial:ready and is seeked in the cut's seconds: the n
await h.seek(0.2);
await expect.poll(() => visibleReadout(h.frame)).toEqual(["—"]);
await expect.poll(() => needleDeg(h.frame)).toBe(-135);
- // After "over 240" (0.6 s) has settled: its weight, the needle at 240 (-105°), its wedge up.
- await h.seek(2.2);
+ // After "over 240" has settled (and the ≈390 is said): its weight, the needle at 240 (-105°), its wedge up.
+ const settled = tOf("w21", 0.9);
+ await h.seek(settled);
await expect.poll(() => visibleReadout(h.frame)).toEqual([">240LB"]);
await expect.poll(() => needleDeg(h.frame)).toBe(-105);
await expect(h.frame.locator('[data-k="q1"]')).toBeVisible();
@@ -117,10 +125,10 @@ test("the dial's page posts dial:ready and is seeked in the cut's seconds: the n
await expect(h.frame.locator('[data-k="gn"]')).toBeVisible();
await expect(h.frame.locator('[data-k="ga0"]')).toContainText("AS OF");
// The last stated weight: 291.5 (-27.75°), and back again -- a seek lands the same from either side.
- await h.seek(7.8);
+ await h.seek(tEnd());
await expect.poll(() => visibleReadout(h.frame)).toEqual(["291.5LB"]);
await expect.poll(() => needleDeg(h.frame)).toBe(-28);
- await h.seek(2.2);
+ await h.seek(settled);
await expect.poll(() => visibleReadout(h.frame)).toEqual([">240LB"]);
await page.screenshot({ path: test.info().outputPath("instruments-dial.png") });
});
@@ -137,7 +145,7 @@ test("the odometer and the trail post ready and seek: the wheels only roll up, t
const y = new DOMMatrix(getComputedStyle(strip).transform).f;
return Math.round(-y / w.getBoundingClientRect().height) % 10;
}).join(""));
- await odo.seek(7.8);
+ await odo.seek(tEnd());
const end = await digits();
await odo.seek(0.1);
const start = await digits();
@@ -149,7 +157,7 @@ test("the odometer and the trail post ready and seek: the wheels only roll up, t
const shown = () => trail.frame.locator(".pt").evaluateAll((ps) => ps.filter((p) => Number(getComputedStyle(p).opacity) > 0.5).length);
await trail.seek(0.3);
await expect.poll(shown).toBe(0);
- await trail.seek(7.8);
+ await trail.seek(tEnd());
await expect.poll(shown).toBe(3);
await expect(trail.frame.locator('[data-k="uc1"]')).toContainText("UNDER 300 · SAID 2×");
await expect(trail.frame.locator('[data-k="uc1"]')).toBeVisible();