aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-18 19:00:14 -0500
committerCraig Jennings <c@cjennings.net>2026-07-18 19:00:14 -0500
commit7e793528900d1965750d4afd7d32125b946babe6 (patch)
treeabb7bf3a235188848c0f1eaf103ee221ead9ae3c /tests
parent055aceb0ea41c394f32f49baa95b8d072f5f0fd0 (diff)
downloadarchsetup-7e793528900d1965750d4afd7d32125b946babe6.tar.gz
archsetup-7e793528900d1965750d4afd7d32125b946babe6.zip
feat(gallery): bring the well-through-response ten to the extraction bar
outputWell, toast, annunciator, tapeCounter, freqScale, patchBay, dataMatrix, warningFlag, seg14, and responseGraph each get the contract comment. The six DOM builders take dupre- prefixes across their markup and CSS blocks. patchBay's live jack and the annunciator's master caution adopt the kit-wide dupre-hot and dupre-on modifiers, and the annunciator board takes dupre-warn and dupre-fault. freqScale reuses the shared scoped dupre-tick and dupre-mk (as the tuner and dualknob do) and compounds its unit label to dupre-fs-band, since dupre-band is the EQ's. The four SVG-stage builders style through the shared .rsvg stage and inline attributes, so they get the SVG-built contract comment and no prefixes. The annunciator documented a 0..2 state per cell but painted an undefined class on an out-of-range initial state or set(). It now clamps at build and at set. Two probe checks cover the batch: one fails red without that clamp, one drives each renamed DOM builder through its handle to catch a class-name mismatch the exception scan can't see. Extraction audit: 104/111 contract comments.
Diffstat (limited to 'tests')
-rw-r--r--tests/gallery-probes/probe.mjs57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/gallery-probes/probe.mjs b/tests/gallery-probes/probe.mjs
index 81ca016..3db09a5 100644
--- a/tests/gallery-probes/probe.mjs
+++ b/tests/gallery-probes/probe.mjs
@@ -1486,6 +1486,63 @@ try {
humid: '#c23a28', aiT: 'rotate(-30.0,65,65) translate(0,-16.0)',
crtMoves: true, crH: 0, crD: '' }), b9dom);
+ // batch-10 domain gate: the annunciator documents a 0..2 state per cell, so
+ // an out-of-range initial state or set() must clamp rather than paint an
+ // undefined class (the mcVu build-enforcement precedent). Without the clamp,
+ // CLS[9] is undefined and get() reads back 0 — this fails RED on that.
+ const clamps10 = await evl(`(() => {
+ const an = DUPRE.annunciator(document.createElement('div'), { cells: [['A', 9], ['B', -3], ['C', 1]] });
+ const anB = an.get();
+ an.set(0, 9); an.set(1, -5);
+ const anSet = an.get();
+ return JSON.stringify({ anB, anSet });
+ })()`);
+ ok('batch-10 domain gate: annunciator state clamps to 0..2 at build and set',
+ clamps10 === JSON.stringify({ anB: [2, 0, 1], anSet: [2, 0, 1] }), clamps10);
+
+ // batch-10 state through the renamed DOM (catches rename stragglers): the six
+ // extracted DOM builders each expose their handle and paint the dupre- classes
+ // — a JS/CSS name mismatch would render unstyled without throwing, so assert
+ // the class names directly. patchBay lights hot jacks and freqScale carries
+ // the compound dupre-fs-band unit label (dupre-band is the EQ's).
+ const b10dom = await evl(`(() => {
+ const ow = DUPRE.outputWell(document.createElement('div'));
+ const owRoot = ow.el.className, owSeed = ow.el.querySelectorAll('.dupre-ostep').length;
+ ow.push(['red', 'Err', 'boom']);
+ const owN = ow.el.querySelectorAll('.dupre-ostep').length;
+ const owEv = ow.el.querySelector('.dupre-ostep:last-child .dupre-ev').textContent;
+ const owRed = ow.el.querySelector('.dupre-ostep:last-child .dupre-lamp').classList.contains('dupre-red');
+ const to = DUPRE.toast(document.createElement('div'));
+ const toRoot = to.el.className; to.fire('ping'); const toTxt = to.el.textContent;
+ const tc = DUPRE.tapeCounter(document.createElement('div'));
+ const tcRoot = tc.el.className;
+ const tcWheels = tc.el.querySelectorAll('.dupre-cwheel').length;
+ const tcRed = tc.el.querySelectorAll('.dupre-redw').length;
+ tc.set(120); const tcV = tc.get();
+ const fq = DUPRE.freqScale(document.createElement('div'));
+ const fqBand = fq.el.querySelector('.dupre-fs-band').textContent;
+ const fqTicks = fq.el.querySelectorAll('.dupre-tick').length > 0;
+ const fqPtr = !!fq.el.querySelector('.dupre-fptr');
+ fq.set(50); const fqV = fq.get();
+ const pb = DUPRE.patchBay(document.createElement('div'));
+ const pbJacks = pb.el.querySelectorAll('.dupre-jack').length;
+ const pbHot = pb.el.querySelectorAll('.dupre-jack.dupre-hot').length;
+ const pbConns = pb.get();
+ const an = DUPRE.annunciator(document.createElement('div'));
+ const anCells = an.el.querySelectorAll('.dupre-acell').length;
+ const anWarn = an.el.querySelectorAll('.dupre-warn').length;
+ const anFault = an.el.querySelectorAll('.dupre-fault').length;
+ const anMcOn = an.el.querySelector('.dupre-mc').classList.contains('dupre-on');
+ return JSON.stringify({ owRoot, owSeed, owN, owEv, owRed, toRoot, toTxt,
+ tcRoot, tcWheels, tcRed, tcV, fqBand, fqTicks, fqPtr, fqV,
+ pbJacks, pbHot, pbConns, anCells, anWarn, anFault, anMcOn });
+ })()`);
+ ok('batch-10 renamed DOM tracks state: well/toast/counter/freqscale/patchbay/annunciator handles + dupre- classes',
+ b10dom === JSON.stringify({ owRoot: 'dupre-owell', owSeed: 2, owN: 3, owEv: 'boom', owRed: true,
+ toRoot: 'dupre-toastw', toTxt: 'ping', tcRoot: 'dupre-counter', tcWheels: 6, tcRed: 2, tcV: 120,
+ fqBand: 'MHz', fqTicks: true, fqPtr: true, fqV: 50, pbJacks: 8, pbHot: 4, pbConns: ['0-5', '2-7'],
+ anCells: 6, anWarn: 1, anFault: 1, anMcOn: true }), b10dom);
+
// late exceptions from interactions
const errs2 = events.filter(e => e.method === 'Runtime.exceptionThrown');
ok('no exceptions after interaction', errs2.length === 0);