aboutsummaryrefslogtreecommitdiffstats
path: root/tools/composer-media-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-07 08:34:13 -0700
committerAdam Soltys <[email protected]>2026-10-07 08:34:13 -0700
commita6bae186071e7e07136a37f63864d0bf578edd16 (patch)
tree6fa8a1086f5b30093f7c9085b6afe06d8c69aa60 /tools/composer-media-test.js
parent7067ed8024cf8d4694fe260df90897c5ebecb245 (diff)
parentdfb017c1b10cb52c24f4f0bcf745c6abea11b98f (diff)
downloadcoinosv3-a6bae186071e7e07136a37f63864d0bf578edd16.tar.gz
coinosv3-a6bae186071e7e07136a37f63864d0bf578edd16.zip
Merge branch 'worktree-agent-a4c5f0908bc7757bf'
Diffstat (limited to 'tools/composer-media-test.js')
-rw-r--r--tools/composer-media-test.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/composer-media-test.js b/tools/composer-media-test.js
index 9b2b41c..6f30995 100644
--- a/tools/composer-media-test.js
+++ b/tools/composer-media-test.js
@@ -17,16 +17,19 @@ const browser = await puppeteer.launch({ executablePath: '/usr/bin/google-chrome
const page = await browser.newPage();
const uploads = [];
await page.setRequestInterception(true);
+// every public media host the upload may try first (nothing leaves the machine)
+const HOSTS = /blossom\.ditto\.pub|blossom\.primal\.net|nostr\.download|nostr\.build/;
page.on('request', (req) => {
const u = req.url();
- if (/nostr\.download|nostr\.build/.test(u) && req.method() === 'PUT') {
+ if (HOSTS.test(u) && req.method() === 'PUT') {
uploads.push(u);
return req.respond({ status: 200, contentType: 'application/json', headers: { 'access-control-allow-origin': '*' },
body: JSON.stringify({ url: 'https://nostr.download/' + 'f'.repeat(64) + '.gif', sha256: 'f'.repeat(64), size: 10, type: 'image/gif' }) });
}
- if (/nostr\.download|nostr\.build/.test(u) && req.method() === 'OPTIONS') {
+ if (HOSTS.test(u) && req.method() === 'OPTIONS') {
return req.respond({ status: 204, headers: { 'access-control-allow-origin': '*', 'access-control-allow-methods': 'PUT, HEAD, GET', 'access-control-allow-headers': '*' } });
}
+ if (HOSTS.test(u) && req.method() === 'HEAD') return req.respond({ status: 200, headers: { 'access-control-allow-origin': '*' } });
req.continue();
});
const click = (t) => page.evaluate((x) => { const e = [...document.querySelectorAll('button')].find((n) => n.textContent.trim().toLowerCase().includes(x)); if (e) { e.click(); return true; } return false; }, t);
@@ -50,10 +53,11 @@ try {
localStorage.setItem(k + ':follows', JSON.stringify({ tags: [['p', a]], c: '', at: now }));
localStorage.setItem(k + ':feedNotes', JSON.stringify([{ id: 'c'.repeat(64), pubkey: a, kind: 1, created_at: now, content: 'a post to answer', tags: [] }]));
localStorage.setItem(k + ':profiles', JSON.stringify({ [a]: { name: 'Poster', t: Date.now() } }));
+ localStorage.setItem('btc-wallet-feed:' + k, 'following'); // new wallets open on Popular
}, [base, A]);
await page.reload({ waitUntil: 'domcontentloaded' });
await waitText('receive', 20000);
- await page.evaluate(() => document.querySelector('.app-bottom-nav .app-nav-button').click());
+ await page.evaluate(() => document.querySelector('.app-nav-button[aria-label="Feed"]').click());
await waitText('a post to answer', 20000);
await page.evaluate(() => [...document.querySelectorAll('.notes-feed [data-key]')].find((n) => n.innerText.includes('a post to answer')).querySelector('button[aria-label="Reply"]').click());
check('the reply box appears', await waitFor(() => !!document.querySelector('.thread-reply-input'), 10000));