diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/media-moments-feed-test.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/media-moments-feed-test.js b/tools/media-moments-feed-test.js index 5b4c8fb..00baf9c 100644 --- a/tools/media-moments-feed-test.js +++ b/tools/media-moments-feed-test.js @@ -140,7 +140,10 @@ try { check('no "at this time" buttons', await page.evaluate(() => !document.body.innerText.includes('at this time'))); await act('.note-audio', 'Like'); await page.waitForSelector('.msg-sheet'); - await page.evaluate(() => document.querySelector('.msg-sheet button').click()); + // the moment is offered, not taken (Adam, 2026-11-14): tick it to tie the reaction to 0:05 + check('the reaction sheet offers the moment, off', await page.evaluate(() => { const b = document.querySelector('.msg-sheet .moment-toggle'); return !!b && b.getAttribute('aria-pressed') === 'false' && b.textContent.includes('0:05'); })); + await page.click('.msg-sheet .moment-toggle'); + await page.evaluate(() => document.querySelector('.msg-sheet button:not(.moment-toggle)').click()); await sleep(400); const reaction = await page.evaluate(() => window.__relayGuard.events.find(e => e.kind === 7 && e.tags.some(t => t[0] === 'media'))); check('reaction is signed with the selected file and position', reaction?.tags.some(t => t[0] === 'media' && t[2] === '5')); @@ -149,7 +152,9 @@ try { await page.screenshot({ path: '/tmp/media-timeline-playing.png' }); await act('.note-audio', 'Reply'); await page.waitForSelector('.thread-reply-input'); - check('timestamp is visible in the reply composer', (await page.evaluate(() => document.body.innerText)).includes('Comment at 0:05')); + check('the reply composer offers the moment, off', await page.evaluate(() => { const b = document.querySelector('.thread-reply .moment-toggle'); return !!b && b.getAttribute('aria-pressed') === 'false' && b.textContent.includes('0:05'); })); + await page.click('.thread-reply .moment-toggle'); + check('…tapped, it is on', await page.evaluate(() => document.querySelector('.thread-reply .moment-toggle').getAttribute('aria-pressed') === 'true')); await page.evaluate(() => { const input = document.querySelector('.thread-reply-input'); input.value = 'Great moment'; input.dispatchEvent(new Event('input', { bubbles: true })); }); await page.click('.thread-reply-send'); await sleep(500); @@ -169,7 +174,8 @@ try { await sleep(150); await page.evaluate(() => document.querySelector('.media-pager .mp-cur .mp-like').click()); await page.waitForSelector('.msg-sheet'); - await page.evaluate(() => document.querySelector('.msg-sheet button').click()); + await page.evaluate(() => document.querySelector('.msg-sheet .moment-toggle').click()); + await page.evaluate(() => document.querySelector('.msg-sheet button:not(.moment-toggle)').click()); await sleep(300); check('video reaction carries the video URL and selected second', await page.evaluate(() => window.__relayGuard.events.some(e => e.kind === 7 && e.tags.some(t => t[0] === 'media' && t[1].endsWith('.mp4') && t[2] === '1')))); check('...and shows over the pager\'s seek bar', await page.waitForFunction(() => !!document.querySelector('.media-pager .mp-cur .mp-seek .mp-mark'), { timeout: 3000 }).then(() => true, () => false)); |
