test(studio): keep mixing-desk words out of the group strip

The design docs live on their own branch and do not travel with this PR, so
the vocabulary rule they carry has no way to reach whoever next edits this
component. It was already broken once this week: the strip shipped a "Bus
level" label and a "how loud this bus is playing right now" tooltip.

Extends the copy test that already guards "no dB" — same idea, same file. It
reads the rendered text AND every title/aria-label, because the regression it
is named for was a tooltip and textContent would have missed it.

Verified against the real defect: restoring the "Bus level" label fails it with
`expected 'Bus level⚠ Too loud…' not to match /\b(bus|submix|fader|insert|send)s?\b/i`.

Also restores the ⚠ the §5 mockup gives "Too loud" in the file's own docblock,
which had drifted from the markup.
This commit is contained in:
Vance Ingalls
2026-08-20 02:16:30 -07:00
parent 58c2e812e9
commit 94f3e5efa7
2 changed files with 25 additions and 1 deletions
@@ -156,4 +156,28 @@ describe("TimelineGroupBusStrip", () => {
});
expect(container.textContent ?? "").not.toMatch(/dB/i);
});
// The design docs live on their own branch and never reach this PR, so the
// vocabulary rule they carry has to be enforced from inside the code or it
// gets re-broken by whoever reads only the component. It already was once:
// this strip shipped a "Bus level" label and a "how loud this bus is playing"
// tooltip. Mixing-desk nouns are ours, for talking to each other — an author
// has never met a bus, a fader, an insert or a send, and will not learn them
// to put reverb on a voiceover.
it("uses no mixing-desk vocabulary in anything the author can read", () => {
vi.useFakeTimers();
renderStrip({ volume: 0.5 });
act(() => {
groupLevels.notify(new Map([["vo", { level: 0.9, clipped: true }]]));
vi.advanceTimersByTime(40);
});
// Tooltips too, not just text: the regression this catches was a `title`.
const readable = [
container.textContent ?? "",
...Array.from(container.querySelectorAll("[title], [aria-label]")).map(
(el) => `${el.getAttribute("title") ?? ""} ${el.getAttribute("aria-label") ?? ""}`,
),
].join(" ");
expect(readable).not.toMatch(/\b(bus|submix|fader|insert|send)s?\b/i);
});
});
@@ -2,7 +2,7 @@
* B7: the group's own volume slider + a living level bar + "Holds …" — the
* bus, not the mechanism. No dB numbers, no peak-hold readout, no routing
* row (groups doc §5, casual-user section) — a slider, a bar that moves with
* the sound, and the words "Too loud" when it clips.
* the sound, and the words "Too loud" when it clips.
*/
import { useEffect, useRef, useState } from "react";
import { useGroupLevel } from "../../hooks/useGroupLevel";