test(2.5d): drive the label-metrics smoke through the public zoom controls (#665)

Validate on c93b3a90 failed no-new-private-writes: the smoke moved the
camera by writing card._view. It now presses the header zoom buttons
(data-hp zoom-fit / zoom-in) until the label font has at least doubled
(14 -> 38 px on the demo stand) and reads the private camera state only to
wait for the transition. Same assertions; the mutant
iso-room-label-44-box-centres-name still turns it red
(gapMatchesFlatAtEveryZoom, gapIsZoomIndependent).

Issue: #665
User-Visible: no
This commit is contained in:
Claude
2026-09-26 15:23:52 +03:00
parent c93b3a90ef
commit 8ffbdf8a28
+19 -17
View File
@@ -30,25 +30,27 @@ const out = await page.evaluate(async () => {
const metrics = label.querySelector('.rlmetrics').getBoundingClientRect();
return { id: label.dataset.id, name: name.height, gap: metrics.top - name.bottom };
});
// Two cameras around the same centre: the label font follows the zoom.
const atZooms = async () => {
const base = { ...card._view };
const rows = [];
for (const factor of [1.6, 0.35]) {
const w = base.w * factor;
const h = base.h * factor;
card._view = { x: base.x + (base.w - w) / 2, y: base.y + (base.h - h) / 2, w, h };
card.requestUpdate();
await card.updateComplete;
await frame();
await frame();
rows.push(measure());
}
card._view = base;
card.requestUpdate();
// Two cameras through the public zoom controls: fit, then zoomed in until
// the label font has at least doubled (the font follows the zoom).
const settleCamera = async () => {
for (let guard = 0; card._cameraTransition?.active && guard < 90; guard++) await frame();
await card.updateComplete;
await frame();
return rows;
};
const press = async (hp) => {
root().querySelector(`[data-hp="${hp}"]`)?.click();
await settleCamera();
};
const atZooms = async () => {
await press('zoom-fit');
const first = measure();
let last = first;
for (let step = 0; step < 8 && last[0] && last[0].name < first[0].name * 2.2; step++) {
await press('zoom-in');
last = measure();
}
await press('zoom-fit');
return [first, last];
};
await window.__hpTest.setVolumetricView(false);