diff options
| author | Adam Soltys <[email protected]> | 2026-09-24 08:16:17 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-24 08:16:17 -0700 |
| commit | cdca3fa061c856f9063aadfabf1c1e713f512123 (patch) | |
| tree | 79f398e0d9570d7fc9f9947ce8e7de3e4e5024f8 /tools/thread-reply-test.js | |
| parent | 7fae8198ef36396e4c65e66597d8e6e6f74ab1d1 (diff) | |
| download | coinosv3-cdca3fa061c856f9063aadfabf1c1e713f512123.tar.gz coinosv3-cdca3fa061c856f9063aadfabf1c1e713f512123.zip | |
Paint cached thread counts and header hat on refresh
Diffstat (limited to 'tools/thread-reply-test.js')
| -rw-r--r-- | tools/thread-reply-test.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/thread-reply-test.js b/tools/thread-reply-test.js index 39f2894..3dba87f 100644 --- a/tools/thread-reply-test.js +++ b/tools/thread-reply-test.js @@ -28,7 +28,7 @@ window.test = { ui, reply, other, root, render, waiting, seedFace: () => createThreadStore().save({ root, replies: [reply] }, reply.id, { [author]: { name: 'Nostrich', picture: 'https://example.com/nostrich.webp', eventAt: 10, t: Date.now(), thumbFor: 'https://example.com/nostrich.webp', thumb: 'data:image/png;base64,iVBORw0KGgo=', thumbPx: 144 }, - }), + }, { [reply.id]: { likes: 29, boosts: 7, sats: 210 } }), release: () => { for (const q of waiting.splice(0)) q.resolve(q.filter.ids ? [root] : []); }, overlay: () => { ui.profilePk = author; ui.profOverThread = true; render(); @@ -101,6 +101,19 @@ try { const row = document.querySelector('.thread-page [data-zap-post]'); return row?.textContent.includes('Nostrich') && row.querySelector('.note-avatar.ava-img')?.style.backgroundImage.includes('data:image/png;base64'); })); + check('cached likes, boosts and sats paint before relay replies', await page.evaluate(() => { + const row = [...document.querySelectorAll('.thread-page [data-zap-post]')] + .find((el) => el.dataset.zapPost === test.reply.id); + const buttons = row?.querySelectorAll('.note-acts > button'); + return buttons?.[1].textContent === '7' && buttons?.[3].textContent === '29' && buttons?.[4].textContent === '210'; + })); + await new Promise((r) => setTimeout(r, 450)); + check('an incomplete relay tally cannot erase the cached numbers', await page.evaluate(() => { + const row = [...document.querySelectorAll('.thread-page [data-zap-post]')] + .find((el) => el.dataset.zapPost === test.reply.id); + const buttons = row?.querySelectorAll('.note-acts > button'); + return buttons?.[1].textContent === '7' && buttons?.[3].textContent === '29' && buttons?.[4].textContent === '210'; + })); assert.deepEqual(errors, []); console.log('✓ no browser errors'); } finally { await browser.close(); server.stop(true); } |
