diff --git a/tests/test_depth.js b/tests/test_depth.js index 82934cb..c286af8 100644 --- a/tests/test_depth.js +++ b/tests/test_depth.js @@ -49,7 +49,7 @@ const fs = require("fs"), path = require("path"), sleep = ms => new Promise(r => // the Hz and everything else on the readout are explained, one click away, and the card goes away again await tab.ev(`${D}.drawNow()`); await sleep(150); check(await tab.ev(`(() => { const b = document.querySelector(".vg-viewhelp"), r = b.getBoundingClientRect(); return !b.hidden && r.width > 0 && document.elementFromPoint(r.x + r.width / 2, r.y + r.height / 2) === b; })()`), "the neural view's help button should be there to press"); - await tab.ev(`document.querySelector(".vg-viewhelp").click()`); const card = await tab.ev(`(() => { const c = document.querySelector(".vg-viewcard"); return !c.hidden && c.getBoundingClientRect().height > 40 ? c.textContent : ""; })()`); for (const w of ["Hz", "spikes per note", "80/20", "×1/25", "thalamus"]) check(card.includes(w), `the help card should explain ${w}`); + await tab.ev(`document.querySelector(".vg-viewhelp").click()`); const card = await tab.ev(`(() => { const c = document.querySelector(".vg-viewcard"); return !c.hidden && c.getBoundingClientRect().height > 40 ? c.textContent : ""; })()`); for (const w of ["Hz", "spikes per note", "80% of cells", "Slowed ×25", "thalamus"]) check(card.includes(w), `the help card should explain ${w}`); await tab.ev(`document.querySelector(".vg-viewhelp").click()`); check(await tab.ev(`document.querySelector(".vg-viewcard").hidden`), "the help card should close"); const before = await tab.ev(`${D}.neuro().spikes`); for (let i = 0; i < 40; i++) { await tab.ev(`${D}.drawNow(performance.now())`); await sleep(50); } const after = await tab.ev(`${D}.neuro()`); check(after.spikes > before, `the network should fire: ${before} then ${after.spikes}`); check(after.ok, `a neuron broke the model's limits: ${JSON.stringify(after)}`);