aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gif-picker-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-10 08:26:59 -0700
committerAdam Soltys <[email protected]>2026-10-10 08:26:59 -0700
commit1573c1d5327ebc941f4308e2b0cc88e85a640add (patch)
treedce8dde9381600072ea6a7b1113c773681839e95 /tools/gif-picker-test.js
parent89b16d6363920129744665ceeda5218f6786aaaa (diff)
downloadcoinosv3-1573c1d5327ebc941f4308e2b0cc88e85a640add.tar.gz
coinosv3-1573c1d5327ebc941f4308e2b0cc88e85a640add.zip
GIFs in replies. The thread's reply box gets the same GIF button as the post composer: a pick lands in the draft (preview opened) and the reply goes out with the GIF's NIP-92 imeta. tools/gif-picker-test.js covers it.
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Vps2H27rhbG9ZqseGfMrc3
Diffstat (limited to 'tools/gif-picker-test.js')
-rw-r--r--tools/gif-picker-test.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/gif-picker-test.js b/tools/gif-picker-test.js
index 172009b..956b4f7 100644
--- a/tools/gif-picker-test.js
+++ b/tools/gif-picker-test.js
@@ -73,6 +73,22 @@ try {
const im = ev && ev.tags.find((x) => x[0] === 'imeta');
check('the note carries a NIP-92 imeta: url, type, size in pixels, alt', !!im && im.some((x) => /^url https:\/\/gifs\.nostr\.build\//.test(x)) && im.some((x) => /^m image\/(gif|webp)$/.test(x)) && im.some((x) => /^dim \d+x\d+$/.test(x)) && im.some((x) => x.startsWith('alt ')), JSON.stringify(im) + ' ' + picked);
+ console.log('\n[in a reply]');
+ await sleep(1500);
+ await page.evaluate((id) => { const r = document.querySelector('[data-zap-post="' + id + '"]'); [...r.querySelectorAll('button')].find((b) => b.getAttribute('aria-label') === 'Reply' || b.title === 'Reply').click(); }, ev.id);
+ check('the reply box has a GIF button', await waitFor(() => !!document.querySelector('.thread-reply .gif-btn'), 10000));
+ await page.evaluate(() => document.querySelector('.thread-reply .gif-btn').click());
+ await waitFor(() => document.querySelectorAll('.gif-grid .gif-tile').length > 0, 20000);
+ await page.evaluate(() => document.querySelector('.gif-grid .gif-tile').click());
+ await sleep(500);
+ const rdraft = await page.evaluate(() => document.querySelector('.thread-reply-input')?.value || '');
+ check('the GIF lands in the reply', /https:\/\/gifs\.nostr\.build\//.test(rdraft), rdraft);
+ await page.evaluate(() => { window.__published = []; document.querySelector('.thread-reply-send').click(); });
+ await waitFor(() => window.__published.some((e) => e.kind === 1), 10000);
+ const rev = await page.evaluate(() => window.__published.find((e) => e.kind === 1));
+ check('the reply goes out naming the post, with the GIF\'s imeta', !!rev && rev.tags.some((x) => x[0] === 'e' && x[1] === ev.id) && rev.tags.some((x) => x[0] === 'imeta' && x.some((y) => /^dim \d+x\d+$/.test(y))), JSON.stringify(rev && rev.tags));
+ await page.evaluate(() => history.back()); await sleep(500);
+
console.log('\n[in a DM]');
await page.evaluate(() => document.querySelector('.app-nav-button[aria-label="Messages"]')?.click());
await waitFor(() => !!document.querySelector('.chat-thread-row .chat-preview'), 10000);