From 95547bc4f3f4f751b8bd86d24cf9cbf2b98e9ea3 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Sun, 23 Aug 2026 12:14:58 -0500 Subject: [PATCH] =?UTF-8?q?Arn=C3=A9s=20de=20pruebas:=20proveer=20document?= =?UTF-8?q?=20al=20c=C3=B3digo=20extra=C3=ADdo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El vigía de congelamiento escucha visibilitychange, y el arnés no proveía document: la suite entera se caía al cargar. Fue mi error de proceso además del de código: empujé el commit anterior sin mirar el resultado de la suite, que es exactamente lo que la suite existe para impedir. Co-Authored-By: Claude Fable 5 --- scripts/test_tv_voz.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/test_tv_voz.js b/scripts/test_tv_voz.js index eef9877..dc3d14e 100644 --- a/scripts/test_tv_voz.js +++ b/scripts/test_tv_voz.js @@ -67,7 +67,7 @@ function escenario({ bloqueado = false, msArranque = 20, caida = false } = {}) { const beacons = []; const sandbox = new Function( 'window', 'setTimeout', 'setInterval', 'SpeechSynthesisUtterance', - 'localStorage', 'navigator', 'Blob', 'Date', + 'localStorage', 'navigator', 'Blob', 'Date', 'document', cuerpo + '; return { anunciarTurno, _uttAncladas };' ); const fakeDate = { now: () => t }; @@ -77,7 +77,8 @@ function escenario({ bloqueado = false, msArranque = 20, caida = false } = {}) { { getItem: () => '[]', setItem: () => {} }, { sendBeacon: (u, b) => beacons.push(u) }, function Blob() {}, - Object.assign(function () { return { toISOString: () => '2026-01-01T00:00:00' }; }, { now: () => t }) + Object.assign(function () { return { toISOString: () => '2026-01-01T00:00:00' }; }, { now: () => t }), + { addEventListener: () => {}, hidden: false } ); const correr = (hastaMs) => { let n = 0; @@ -203,12 +204,13 @@ function escenario({ bloqueado = false, msArranque = 20, caida = false } = {}) { }; const api = new Function( 'window', 'setTimeout', 'setInterval', 'SpeechSynthesisUtterance', - 'localStorage', 'navigator', 'Blob', 'Date', + 'localStorage', 'navigator', 'Blob', 'Date', 'document', cuerpo + '; return { anunciarTurno };' )({ speechSynthesis: synth }, st, () => {}, Utt, { getItem: () => '[]', setItem: () => {} }, { sendBeacon: () => {} }, function Blob() {}, - Object.assign(function () { return { toISOString: () => '2026-01-01T00:00:00' }; }, { now: () => t })); + Object.assign(function () { return { toISOString: () => '2026-01-01T00:00:00' }; }, { now: () => t }), + { addEventListener: () => {}, hidden: false }); api.anunciarTurno('A01', 'Consultorio 2', 'maría fernanda gómez', () => {}); let n = 0;