diff options
| author | Adam Soltys <[email protected]> | 2026-09-23 23:00:31 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-23 23:00:31 -0700 |
| commit | f6fd9f998831330e3a8819e294cdd8d15c1a87f6 (patch) | |
| tree | 3d8399d75efffc9c9bd091280984c8776682cd05 /tools/post-actions-test.js | |
| parent | 75679fdd5d24d36e3c54316e88ccefcf954afc82 (diff) | |
| download | coinosv3-f6fd9f998831330e3a8819e294cdd8d15c1a87f6.tar.gz coinosv3-f6fd9f998831330e3a8819e294cdd8d15c1a87f6.zip | |
Videos play by themselves, muted, while on screen — with an Unmute button; YouTube too.
An inline video starts as it scrolls into view (muted, the only way a
browser lets a page start one), pauses as it leaves, and a corner button
turns the sound on; the native controls' own mute keeps the button honest.
A YouTube box loads its player muted once in view (enablejsapi, so the
same button can unmute it over the iframe API) and pauses out of view; a
tap on the poster still means sound. One IntersectionObserver watches
every player. Data Saver keeps tap-to-play.
Tests adapted to the feed's new admission rule (a row waits for its
author's face and pictures): the markdown and post-actions tests seed the
poster's profile and serve their pictures locally; a picture that cannot
be decoded is now a link, by design.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Diffstat (limited to 'tools/post-actions-test.js')
| -rw-r--r-- | tools/post-actions-test.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/post-actions-test.js b/tools/post-actions-test.js index b7d56e6..d8c4c84 100644 --- a/tools/post-actions-test.js +++ b/tools/post-actions-test.js @@ -52,13 +52,16 @@ try { localStorage.setItem(k + ':feedNotes', JSON.stringify([ { id: nid, pubkey: pk, kind: 1, created_at: Math.floor(Date.now()/1000), content: 'More flowers http://localhost:5258/pic.png', tags: [] }, ])); + // a known face: a row is admitted once its author's picture has been tried + localStorage.setItem(k + ':profiles', JSON.stringify({ [pk]: { name: 'Flower Poster', t: Date.now() } })); }, [base, AUTHOR, NOTE_ID]); await page.reload({ waitUntil: 'domcontentloaded' }); await waitText('receive', 20000); await page.evaluate(() => { const b = [...document.querySelectorAll('button')].find((e) => /message/i.test(e.getAttribute('aria-label') || '')); if (b) b.click(); }); await sleep(1000); await page.evaluate(() => { const e = [...document.querySelectorAll('.item')].find((n) => /feed/i.test(n.textContent)); if (e) e.click(); }); - await sleep(2500); + for (let i = 0; i < 48; i++) { if (await page.$('.note-act')) break; await sleep(250); } + await sleep(600); const acts = await page.evaluate(() => [...document.querySelectorAll('.note-act')].map((b) => b.getAttribute('aria-label'))); check('every action sits under the post', acts.slice(0, 4).join(',') === 'Reply,Boost,Quote,Like', acts.join(',') || 'none'); |
