← Commit history

0.21.5: review-tour spotlight never bakes into the PNG

Colby Knox ·502f8f55f6 ·22d ago ·parent f7fc2fe
1 file changed +16
test/render-view.mjs+16
@@ -88,6 +88,22 @@ try {   ok('render view makes no state-changing POST', posts.length === 0, posts.slice(0, 3).join(', '));   ok('render view still renders the hero', !!(await view.$('#hero')));   const booted = await view.evaluate(() => typeof $ === 'function' && typeof render === 'function');+  // A pose turns the review tour on, and the tour spotlights the first+  // unchecked item (the title) with an outline. With nothing ticked, that+  // outline used to be drawn in the render view and baked into the PNG.+  await fetch(base + '/state', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ aiThread: 'render-view test', tour: true, verify: true, confirm: {} }) });+  const tv = await browser.newPage();+  await tv.setViewport({ width: 1680, height: 1080, deviceScaleFactor: 1 });+  await tv.goto(base + '/?render=1', { waitUntil: 'networkidle2', timeout: 15000 }).catch(() => {});+  await new Promise(r => setTimeout(r, 1200));+  const ring = await tv.evaluate(() => {+    const lit = [...document.querySelectorAll('.tour-glow')].map(e => e.id || e.className);+    const t = document.getElementById('el-title');+    const cs = t && getComputedStyle(t);+    return { lit, outline: cs ? cs.outlineStyle + ' ' + cs.outlineWidth : 'no title', shadow: cs ? cs.boxShadow : '' };+  });+  ok('the review-tour spotlight never appears in the render view (tour on, nothing ticked)', ring.lit.length === 0, JSON.stringify(ring));+  ok('the render view draws no outline around the title', !/solid/.test(ring.outline), JSON.stringify(ring));   ok('the page scripts parse and boot (app.js defines $ and render)', booted);    ctl.abort();