aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/gallery-probes/probe.mjs35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/gallery-probes/probe.mjs b/tests/gallery-probes/probe.mjs
index e4696ad..87197d2 100644
--- a/tests/gallery-probes/probe.mjs
+++ b/tests/gallery-probes/probe.mjs
@@ -1165,6 +1165,41 @@ try {
ok('presetBank and dualKnob set() clamp out-of-range input',
clamps === JSON.stringify({ hi: 3, lo: 0, o: 100, i: 0 }), clamps);
+ // Batch-4 set() hardening, same detached-host shape: vernierDial and
+ // flutedKnob clamp 0-100; filterBank clamps the band index (an out-of-range
+ // band lands on the last, it doesn't throw); multiBandDial clamps the band
+ // to its rings and keeps the current band when set() omits it.
+ const clamps4 = await evl(`(() => {
+ const vd = DUPRE.vernierDial(document.createElement('div'));
+ vd.set(500); const vHi = vd.get();
+ vd.set(-5); const vLo = vd.get();
+ const fk = DUPRE.flutedKnob(document.createElement('div'));
+ fk.set(500); const fHi = fk.get();
+ const fb = DUPRE.filterBank(document.createElement('div'));
+ fb.set(99, 30); const fbLast = fb.get()[11];
+ const mb = DUPRE.multiBandDial(document.createElement('div'));
+ mb.set(50, 99); const [, bHi] = mb.get();
+ mb.set(70); const [v2, bKeep] = mb.get();
+ return JSON.stringify({ vHi, vLo, fHi, fbLast, bHi, v2, bKeep });
+ })()`);
+ ok('batch-4 set() clamps: vernier/fluted 0-100, filterBank + multiBand band index',
+ clamps4 === JSON.stringify({ vHi: 100, vLo: 0, fHi: 100, fbLast: 30, bHi: 3, v2: 70, bKeep: 3 }), clamps4);
+
+ // The batch-4 rename holds end to end: a detached dipBank round-trips its
+ // word through the dupre- prefixed switch classes, and jogWheel's cached
+ // inner disc actually rotates on set.
+ const b4dom = await evl(`(() => {
+ const db = DUPRE.dipBank(document.createElement('div'));
+ db.set('101');
+ const jw = DUPRE.jogWheel(document.createElement('div'));
+ jw.set(10);
+ const inner = jw.el.querySelector('.dupre-inner');
+ return JSON.stringify({ word: db.get(), sw: db.el.querySelectorAll('.dupre-dipsw').length,
+ rot: inner ? inner.style.transform : 'missing' });
+ })()`);
+ ok('dipBank word round-trips and jogWheel rotates via dupre- classes',
+ b4dom === JSON.stringify({ word: '101000', sw: 6, rot: 'rotate(40deg)' }), b4dom);
+
// late exceptions from interactions
const errs2 = events.filter(e => e.method === 'Runtime.exceptionThrown');
ok('no exceptions after interaction', errs2.length === 0);