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;